Use C idris2_time for all C-based backends

This commit is contained in:
Stiopa Koltsov 2021-06-28 23:09:55 +01:00
parent 6f9b926b1b
commit 3d5ad0ca91
4 changed files with 2 additions and 8 deletions

View File

@ -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)

View File

@ -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))

View File

@ -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)))

View File

@ -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))