(* For interactive sessions *) load "Timer"; load "Time"; load "Random"; local open Timer; open Time; in (* function timeIt f arg TYPE: ('a -> 'b) -> 'a -> real PRE: (none) POST: the time, in seconds, for executing f(arg) *) fun timeIt f arg = let val t = startCPUTimer() val _ = f arg val t' = checkCPUTimer(t) in toReal (#usr(t') ) end; end;