Module Runtime

module Runtime: sig .. end
Access to miscellaneous runtime values.


Time

 
val current_time_millis : unit -> int64
Returns the current time in milliseconds.
 
val nano_time : unit -> int64
Similar to current_time_millis, with greater resolution.
 

Processors

 
val available_processors : unit -> int32
Returns the number of (logical) available processors.
 

Memory

 
val free_memory : unit -> int64
Returns the amount of free memory in the JVM (in bytes).
 
val max_memory : unit -> int64
Returns the maximum amount of memory to be used by the JVM (in bytes).
 
val total_memory : unit -> int64
Returns the total amount of memory used by the JVM (in bytes).
 

Exceptions

 
exception Interrupted of string
Raised when a function is interrupted, using the string parameter to indicate the name of the function.
 
exception Timeout of string
Raised when a function has been waiting for the allocated amount of time, using the string parameter to indicate the name of the function.
 
exception Raised of exn
Raised when a passed function raised an exception, using the parameter to store the originally raised exception.