/[cmucl]/src/code/time.lisp
ViewVC logotype

Diff of /src/code/time.lisp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by ram, Thu Feb 22 16:25:38 1990 UTC revision 1.3.1.1 by wlott, Wed Jul 4 21:52:24 1990 UTC
# Line 33  Line 33 
33  ;;; Get-Internal-Real-Time  --  Public  ;;; Get-Internal-Real-Time  --  Public
34  ;;;  ;;;
35  ;;;  ;;;
36    #+nil
37  (defun get-internal-real-time ()  (defun get-internal-real-time ()
38    "Return the real time in the internal time format.  This is useful for    "Return the real time in the internal time format.  This is useful for
39    finding elapsed time.  See Internal-Time-Units-Per-Second."    finding elapsed time.  See Internal-Time-Units-Per-Second."
# Line 41  Line 42 
42        (error "Failed to get real time."))        (error "Failed to get real time."))
43      val))      val))
44    
 #|  
45  (defun get-internal-real-time ()  (defun get-internal-real-time ()
46    "Return the real time in the internal time format.  This is useful for    "Return the real time in the internal time format.  This is useful for
47    finding elapsed time.  See Internal-Time-Units-Per-Second."    finding elapsed time.  See Internal-Time-Units-Per-Second."
# Line 49  Line 49 
49      (if result (+ (* seconds internal-time-units-per-second) useconds)      (if result (+ (* seconds internal-time-units-per-second) useconds)
50          (error "Unix system call gettimeofday failed: ~A"          (error "Unix system call gettimeofday failed: ~A"
51                 (mach:get-unix-error-msg seconds)))))                 (mach:get-unix-error-msg seconds)))))
 |#  
52    
53  ;;; Get-Internal-Run-Time  --  Public  ;;; Get-Internal-Run-Time  --  Public
54  ;;;  ;;;
55  ;;; PmGetTimes returns run time in microseconds.  Convert to jiffies.  ;;; PmGetTimes returns run time in microseconds.  Convert to jiffies.
56  ;;;  ;;;
57    #+nil
58  (defun get-internal-run-time ()  (defun get-internal-run-time ()
59    "Return the run time in the internal time format.  This is useful for    "Return the run time in the internal time format.  This is useful for
60    finding CPU usage."    finding CPU usage."
# Line 63  Line 63 
63        (error "Failed to obtain run time."))        (error "Failed to obtain run time."))
64      val))      val))
65    
 #|  
66  (defun get-internal-run-time ()  (defun get-internal-run-time ()
67    "Return the run time in the internal time format.  This is useful for    "Return the run time in the internal time format.  This is useful for
68    finding CPU usage."    finding CPU usage."
# Line 72  Line 71 
71      (if result (+ utime stime)      (if result (+ utime stime)
72          (error "Unix system call getrusage failed: ~A"          (error "Unix system call getrusage failed: ~A"
73                 (mach:get-unix-error-msg utime)))))                 (mach:get-unix-error-msg utime)))))
74  |#  
75    
76  ;;; Subtract from the returned Internal_Time to get the universal time.  ;;; Subtract from the returned Internal_Time to get the universal time.
77  ;;; The offset between our time base and the Perq one is 2145 weeks and  ;;; The offset between our time base and the Perq one is 2145 weeks and
# Line 268  Line 267 
267    "Evaluates the Form and prints timing information on *Trace-Output*."    "Evaluates the Form and prints timing information on *Trace-Output*."
268    `(%time #'(lambda () ,form)))    `(%time #'(lambda () ,form)))
269    
270    #+nil
271  (defun %time (fun)  (defun %time (fun)
272    (let (old-run-utime    (let (old-run-utime
273          new-run-utime          new-run-utime

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.3.1.1

  ViewVC Help
Powered by ViewVC 1.1.5