mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-12-28 22:22:10 +03:00
Use C idris2_time for all C-based backends
This commit is contained in:
parent
6f9b926b1b
commit
3d5ad0ca91
@ -107,10 +107,10 @@ export
|
||||
system : HasIO io => String -> io Int
|
||||
system cmd = primIO (prim__system cmd)
|
||||
|
||||
%foreign support "idris2_time"
|
||||
"scheme:blodwen-time"
|
||||
%foreign "C:idris2_time, libidris2_support, idris2_support.h"
|
||||
prim__time : PrimIO Int
|
||||
|
||||
||| Return the number of seconds since epoch.
|
||||
export
|
||||
time : HasIO io => io Integer
|
||||
time = pure $ cast !(primIO prim__time)
|
||||
|
@ -381,7 +381,6 @@
|
||||
(micro (mod s 1000000)))
|
||||
(sleep (make-time 'time-duration (* 1000 micro) sec))))
|
||||
|
||||
(define (blodwen-time) (time-second (current-time)))
|
||||
(define (blodwen-clock-time-utc) (current-time 'time-utc))
|
||||
(define (blodwen-clock-time-monotonic) (current-time 'time-monotonic))
|
||||
(define (blodwen-clock-time-duration) (current-time 'time-duration))
|
||||
|
@ -213,9 +213,6 @@
|
||||
(define blodwen-sleep thread-sleep!)
|
||||
(define (blodwen-usleep s) (thread-sleep! (/ s 1e6)))
|
||||
|
||||
(define (blodwen-time)
|
||||
(exact-floor (time->seconds (current-time))))
|
||||
|
||||
|
||||
(define (blodwen-arg-count)
|
||||
(length (command-line)))
|
||||
|
@ -432,8 +432,6 @@
|
||||
(define (blodwen-sleep s) (sleep s))
|
||||
(define (blodwen-usleep us) (sleep (* 0.000001 us)))
|
||||
|
||||
(define (blodwen-time) (current-seconds))
|
||||
|
||||
(define (blodwen-clock-time-utc) (current-time 'time-utc))
|
||||
(define (blodwen-clock-time-monotonic) (current-time 'time-monotonic))
|
||||
(define (blodwen-clock-time-duration) (current-time 'time-duration))
|
||||
|
Loading…
Reference in New Issue
Block a user