Skip to content

Commit

Permalink
[project @ Added %unix-gettimeofday with implementation for SBCL, CCL…
Browse files Browse the repository at this point in the history
… and CMUCL]

Maps to whatever the CL implementation has to access the UNIX
gettimeofday(2) function. Returns NIL when the current implementation
is not supported.
  • Loading branch information
Arjan Wekking committed Jul 22, 2008
1 parent 4d157a0 commit acf3d38
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/local-time.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -871,6 +871,18 @@
+seconds-per-day+)
(sec-of timestamp)))

(defun %unix-gettimeofday ()
#+cmu
(unix:unix-gettimeofday)
#+sbcl
(sb-unix:unix-gettimeofday)
#+ccl
(ccl::rlet ((tv :timeval))
(#_gettimeofday tv (ccl::%null-ptr))
(values t (ccl::pref tv :timeval.tv_sec) (ccl::pref tv :timeval.tv_usec)))
#-(or sbcl ccl cmu)
(values nil 0 0))

(defun now (&key nsec)
#+sbcl
(multiple-value-bind (_ sec usec)
Expand Down

0 comments on commit acf3d38

Please sign in to comment.