-(defconstant micro-seconds-per-internal-time-unit
- (/ 1000000 sb!xc:internal-time-units-per-second))
-\f
-;;; The base number of seconds for our internal "epoch". We initialize
-;;; this to the time of the first call to GET-INTERNAL-REAL-TIME, and
-;;; then subtract this out of the result.
-(defvar *internal-real-time-base-seconds* nil)
-(declaim (type (or (unsigned-byte 32) null) *internal-real-time-base-seconds*))
-
-(defun get-internal-real-time ()
- #!+sb-doc
- "Return the real time in the internal time format. (See
- INTERNAL-TIME-UNITS-PER-SECOND.) This is useful for finding elapsed time."
- (multiple-value-bind (ignore seconds useconds) (sb!unix:unix-gettimeofday)
- (declare (ignore ignore) (type (unsigned-byte 32) seconds useconds))
- (let ((base *internal-real-time-base-seconds*)
- (uint (truncate useconds
- micro-seconds-per-internal-time-unit)))
- (declare (type (unsigned-byte 32) uint))
- (cond (base
- (truly-the (unsigned-byte 32)
- (+ (the (unsigned-byte 32)
- (* (the (unsigned-byte 32) (- seconds base))
- sb!xc:internal-time-units-per-second))
- uint)))
- (t
- (setq *internal-real-time-base-seconds* seconds)
- uint)))))
+;;; Implemented in unix.lisp and win32.lisp.
+#!+sb-doc
+(setf (fdocumentation 'get-internal-real-time 'function)
+ "Return the real time (\"wallclock time\") since startup in the internal
+time format. (See INTERNAL-TIME-UNITS-PER-SECOND.)")