<commit_before>USING: help.markup help.syntax memory system tools.dispatch
tools.memory quotations vm ;
IN: tools.time

ARTICLE: "timing" "Timing code and collecting statistics"
"You can time the execution of a quotation in the listener:"
{ $subsections time }
"This word also collects statistics about method dispatch and garbage collection:"
{ $subsections dispatch-stats. gc-events. gc-stats. gc-summary. }
"A lower-level word puts timings on the stack, intead of printing:"
{ $subsections benchmark }
"You can also read the system clock directly; see " { $link "system" } "."
{ $see-also "profiling" "calendar" } ;

ABOUT: "timing"

HELP: benchmark
{ $values { "quot" quotation }
          { "runtime" "the runtime in microseconds" } }
      { $description "Runs a quotation, measuring the total wall clock time." }
{ $notes "A nicer word for interactive use is " { $link time } "." } ;

HELP: time
{ $values { "quot" quotation } }
{ $description "Runs a quotation, gathering statistics about method dispatch and garbage collection, and then prints the total run time." } ;

{ benchmark time } related-words

HELP: collect-gc-events
{ $values { "quot" quotation } { "gc-events" "a sequence of " { $link gc-event } " instances" } }
{ $description "Calls the quotation and outputs a sequence of " { $link gc-event } " instances." }
{ $notes "The " { $link time } " combinator automatically calls this combinator." } ;

HELP: collect-dispatch-stats
{ $values { "quot" quotation } { "dispatch-statistics" dispatch-statistics } }
{ $description "Calls the quotation and outputs a " { $link dispatch-statistics } " instance." }
{ $notes "The " { $link time } " combinator automatically calls this combinator." } ;<commit_msg>tools.time: fix documentation error (reported by <NAME>)<commit_after>USING: help.markup help.syntax memory system tools.dispatch
tools.memory quotations vm ;
IN: tools.time

ARTICLE: "timing" "Timing code and collecting statistics"
"You can time the execution of a quotation in the listener:"
{ $subsections time }
"This word also collects statistics about method dispatch and garbage collection:"
{ $subsections dispatch-stats. gc-events. gc-stats. gc-summary. }
"A lower-level word puts timings on the stack, intead of printing:"
{ $subsections benchmark }
"You can also read the system clock directly; see " { $link "system" } "."
{ $see-also "profiling" "calendar" } ;

ABOUT: "timing"

HELP: benchmark
{ $values { "quot" quotation }
          { "runtime" "the runtime in nanoseconds" } }
      { $description "Runs a quotation, measuring the total wall clock time." }
{ $notes "A nicer word for interactive use is " { $link time } "." } ;

HELP: time
{ $values { "quot" quotation } }
{ $description "Runs a quotation, gathering statistics about method dispatch and garbage collection, and then prints the total run time." } ;

{ benchmark time } related-words

HELP: collect-gc-events
{ $values { "quot" quotation } { "gc-events" "a sequence of " { $link gc-event } " instances" } }
{ $description "Calls the quotation and outputs a sequence of " { $link gc-event } " instances." }
{ $notes "The " { $link time } " combinator automatically calls this combinator." } ;

HELP: collect-dispatch-stats
{ $values { "quot" quotation } { "dispatch-statistics" dispatch-statistics } }
{ $description "Calls the quotation and outputs a " { $link dispatch-statistics } " instance." }
{ $notes "The " { $link time } " combinator automatically calls this combinator." } ;
{'fraction_non_alphanumeric': 0.12041284403669725, 'fraction_numerical': 0.0, 'mean_word_length': 4.254518072289157, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2210357', 'n_tokens_mistral': 1026, 'n_tokens_neox': 977, 'n_words': 390}