- (+ (the (unsigned-byte 32)
- (* (the (unsigned-byte 32) (+ utime-sec stime-sec))
- internal-time-units-per-second))
- (truncate (+ utime-usec stime-usec)
- micro-seconds-per-internal-time-unit))))
-
-#!+(and sparc svr4)
-(defun get-internal-run-time ()
- #!+sb-doc
- "Return the run time in the internal time format. This is useful for
- finding CPU usage."
- (declare (values (unsigned-byte 32)))
- ;; FIXME: See comment on OPTIMIZE declaration in other
- ;; version of GET-INTERNAL-RUN-TIME.
- (declare (optimize (speed 3) (safety 3)))
- (multiple-value-bind (ignore utime stime cutime cstime)
- (sb!unix:unix-times)
- (declare (ignore ignore cutime cstime)
- (type (unsigned-byte 31) utime stime))
- (the (unsigned-byte 32) (+ utime stime))))
+ (let ((result (+ (the (unsigned-byte 32)
+ (* (the (unsigned-byte 32) (+ utime-sec stime-sec))
+ sb!xc:internal-time-units-per-second))
+ (floor (+ utime-usec
+ stime-usec
+ (floor micro-seconds-per-internal-time-unit 2))
+ micro-seconds-per-internal-time-unit))))
+ result)))