1 ! (c)2009 Joe Groff bsd license
2 USING: accessors alien.c-types classes.struct game.loop
3 game.loop.private kernel sequences specialized-vectors
5 IN: game.loop.benchmark
7 STRUCT: game-loop-benchmark
8 { benchmark-data-pair benchmark-data-pair }
10 { frame# ulonglong } ;
12 SPECIALIZED-VECTOR: game-loop-benchmark
14 : <game-loop-benchmark> ( benchmark-data-pair tick frame -- obj )
15 \ game-loop-benchmark <struct>
18 swap >>benchmark-data-pair ; inline
20 : ensure-benchmark-data ( loop -- vector )
21 dup benchmark-data>> [
22 game-loop-benchmark-vector{ } clone
25 benchmark-data>> ; inline
27 M: game-loop record-benchmarking ( loop quot: ( loop -- benchmark-data-pair ) -- )
29 [ [ call( loop -- ) ] with-benchmarking ]
35 [ drop ensure-benchmark-data ]