1 ! Copyright (C) 2003, 2010 Slava Pestov.
2 ! See https://factorcode.org/license.txt for BSD license.
3 USING: system kernel math namespaces io prettyprint tools.memory
7 : benchmark ( quot -- runtime )
8 nano-count [ call nano-count ] dip - ; inline
11 "Running time: " write 1000000000 /f pprint " seconds" print ;
14 "Additional information was collected." print
15 "dispatch-stats. - Print method dispatch statistics" print
16 "gc-events. - Print all garbage collection events" print
17 "gc-stats. - Print breakdown of different garbage collection events" print
18 "gc-summary. - Print aggregate garbage collection statistics" print flush ;
22 [ benchmark ] collect-dispatch-stats last-dispatch-stats set
23 ] collect-gc-events gc-events set
24 time. nl time-banner. ; inline