]> gitweb.factorcode.org Git - factor.git/blob - basis/tools/time/time-docs.factor
merge project-euler.factor
[factor.git] / basis / tools / time / time-docs.factor
1 USING: help.markup help.syntax memory system ;
2 IN: tools.time
3
4 ARTICLE: "timing" "Timing code"
5 "You can time the execution of a quotation in the listener:"
6 { $subsections time }
7 "A lower-level word puts timings on the stack, intead of printing:"
8 { $subsections benchmark }
9 "You can also read the system clock and garbage collection statistics directly:"
10 { $subsections
11     micros
12     gc-stats
13 }
14 { $see-also "profiling" } ;
15
16 ABOUT: "timing"
17
18 HELP: benchmark
19 { $values { "quot" "a quotation" }
20           { "runtime" "the runtime in microseconds" } }
21       { $description "Runs a quotation, measuring the total wall clock time." }
22 { $notes "A nicer word for interactive use is " { $link time } "." } ;
23
24 HELP: time
25 { $values { "quot" "a quotation" } }
26 { $description "Runs a quotation and then prints the total run time and some garbage collection statistics." } ;
27
28 { benchmark micros time } related-words