timev
9.0
top
← prev up next →

timevπŸ”— i

Laurent Orseau

timev is a more flexible variant of time .

procedure

( timev-apply label[#:disp?disp?]procarg...)any

label:string?
disp?:any/c=(*timev?* )
proc:procedure?
arg:any/c
Similar to time but prefixes the displayed time string with label.

If disp? is #f, no timing information is displayed.

Nested calls to timev-apply are indented to reflect the nesting.

syntax

( timev label[#:disp?(*timev?*)]body...)

A more practical form of timev-apply .

Example:
> (timev "Level 0"
(timev "Level 1a"
(timev "Level 2"
(displayln "Some user output from level 2")))
(timev "Level 1b"
(displayln "Some user output from level 1"))
(displayln "Some user output from level 0"))

Some user output from level 2

Level 2 cpu: 0 real: 0 gc: 0

Level 1a cpu: 0 real: 0 gc: 0

Some user output from level 1

Level 1b cpu: 0 real: 0 gc: 0

Some user output from level 0

Level 0 cpu: 0 real: 0 gc: 0

procedure

( *timev?* )boolean?

= #t
A global to make it easy to turn on/off timev information with a switch from the command line.

For example:
(require timev global)
 
(*timev?* #f);turntimevdisplayoffbydefault
 
;;Usethe--timevswitchfromthecommandline
;;todisplaytimevinformation
(void (globals->command-line ));parsethecommandline
 
(timev "Calculationtime:"
(+ 12))
 
(timev "Neverprintme"#:disp?#f
(+ 12))

top
← prev up next →

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /