Module JavaSystem

module JavaSystem: sig .. end
Miscellaneous (properties, time, garbage collection, environment).


Properties

 
val clear_property : JavaString.t -> JavaString.t
clear_property name removes the system property named name, returning its previous value if any; see clearProperty(...).
Raises
  • Java_exception if name is null
  • Java_exception if name is empty
  • Java_exception if security manager doesn't allow property modification
 
val get_property : JavaString.t -> JavaString.t
get_property name returns the value of the system property named name if defined, null otherwise; see getProperty(...).
Raises
  • Java_exception if name is null
  • Java_exception if name is empty
  • Java_exception if security manager doesn't allow property lookup
 
val get_property_default : JavaString.t -> JavaString.t -> JavaString.t
get_property_default name default returns the value of the system property named name if defined, default otherwise; see getProperty(...).
Raises
  • Java_exception if name is null
  • Java_exception if name is empty
  • Java_exception if security manager doesn't allow property lookup
 
val set_property : JavaString.t -> JavaString.t -> JavaString.t
set_property name value change the system property named name to value, returning its previous value if any; see setProperty(...).
Raises
  • Java_exception if name is null
  • Java_exception if name is empty
  • Java_exception if security manager doesn't allow property modification
 

Time

 
val current_time_millis : unit -> java_long
Returns the number of milliseconds since January 1, 1970 UTC at midnight; see currentTimeMillis(...).
 
val nano_time : unit -> java_long
Returns the value of the high-resolution time source in nanoseconds. Should be used to measure elapsed time; see nanoTime(...).
 

Garbage collector

 
val gc : unit -> unit
Runs the garbage collector; see gc(...).
 
val run_finalization : unit -> unit
Runs the finalization methods of objects pending finalization; see runFinalization(...).
 

Environment

 
val get_env : JavaString.t -> JavaString.t
get_env name returns the value of the environment variable named name if defined, null otherwise; see getenv(...).
Raises
  • Java_exception if name is null
  • Java_exception if security manager doesn't allow environment variable lookup