next up previous index
Next: Reflection Up: Miscellaneous Previous: Graphs and partial orders   Index

System operations

In system.diesel:

extend module Stdlib;
module System;
fun exit(error_code:int):none;
fun object_size(obj:any):int;
fun individual_object_size(obj:any):indexed[int];
fun object_size_histogram(obj:any):int;
fun PIC_statistics():void;
fun detailed_PIC_statistics():void;
fun cpu_time():int;  - Current CPU time in milliseconds.
fun time(closure:&():void):int;  - CPU execution time of closure in milliseconds
fun time_value(closure:&():`T):pair[int,T];  - return both the time and the closure's result
fun benchmark_closure(cls:&():void):void;
The system function invokes the Unix system system call with the given command, and passes the returned value to the user. The if_error closure is invoked if the system call returns a non-zero result.

fun system(s:string):int;
fun system(s:string, if_error:&(i:int):int):int;
fun breakpoint():void;
fun sys_breakpoint():void;
object argv isa i_indexed_exactly[string];  - Unix command-line arguments
Unix environment variables can be read and modified.

object env isa m_table_like[string,string];
fun fetch_internal(t:env, name:vstring):string;
fun store_internal(t:env, n:vstring, v:vstring):void;
fun garbage_collect():void;
fun print_heap():void;
fun process_size():int;
fun compile_date():string;
fun zero_runtime_counters():void;
fun print_and_zero_runtime_counters():void;
fun profiling_on():void;
fun profiling_off():void;
fun profile(c:&():`T):T;
fun profile(b:bool, c:&():`T):T;
end module System;


next up previous index
Next: Reflection Up: Miscellaneous Previous: Graphs and partial orders   Index

Cecil/Vortex Project