summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/sail_lib.ml4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/sail_lib.ml b/src/sail_lib.ml
index e839d142..99ce04a5 100644
--- a/src/sail_lib.ml
+++ b/src/sail_lib.ml
@@ -591,3 +591,7 @@ let shift_bits_left (x, y) =
shiftl (x, uint(y))
let speculate_conditional_success () = true
+
+(* Return nanoseconds since epoch. Truncates to ocaml int but will be OK for next 100 years or so... *)
+let get_time_ns () = Big_int.of_int (int_of_float (1e9 *. Unix.gettimeofday ()))
+