1 ! Copyright (C) 2003, 2008 Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: kernel math math.vectors memory io io.styles prettyprint
4 namespaces system sequences splitting grouping assocs strings ;
7 : benchmark ( quot -- runtime )
8 micros [ call micros ] dip - ; inline
12 "==== RUNNING TIME" print nl 1000000 /f pprint " seconds" print nl
14 "==== GARBAGE COLLECTION" print nl
19 "Cumulative GC time (us):"
20 "Longest GC pause (us):"
21 "Average GC pause (us):"
26 { "" "Nursery" "Aging" "Tenured" } prefix
35 "Code heap literal scans:"
36 } swap zip simple-table.
40 gc-reset micros [ call gc-stats micros ] dip - prefix time. ; inline