equal
deleted
inserted
replaced
23 */ |
23 */ |
24 |
24 |
25 #include "precompiled.hpp" |
25 #include "precompiled.hpp" |
26 #include "gc/shared/gcTimer.hpp" |
26 #include "gc/shared/gcTimer.hpp" |
27 #include "utilities/growableArray.hpp" |
27 #include "utilities/growableArray.hpp" |
28 #include "utilities/ticks.inline.hpp" |
|
29 |
28 |
30 // the "time" parameter for most functions |
29 // the "time" parameter for most functions |
31 // has a default value set by Ticks::now() |
30 // has a default value set by Ticks::now() |
32 |
31 |
33 void GCTimer::register_gc_start(const Ticks& time) { |
32 void GCTimer::register_gc_start(const Ticks& time) { |
374 |
373 |
375 static void gc_start() { |
374 static void gc_start() { |
376 GCTimer gc_timer; |
375 GCTimer gc_timer; |
377 gc_timer.register_gc_start(1); |
376 gc_timer.register_gc_start(1); |
378 |
377 |
379 assert(gc_timer.gc_start() == 1, "Incorrect"); |
378 assert(gc_timer.gc_start() == Ticks(1), "Incorrect"); |
380 } |
379 } |
381 |
380 |
382 static void gc_end() { |
381 static void gc_end() { |
383 GCTimer gc_timer; |
382 GCTimer gc_timer; |
384 gc_timer.register_gc_start(1); |
383 gc_timer.register_gc_start(1); |
385 gc_timer.register_gc_end(2); |
384 gc_timer.register_gc_end(2); |
386 |
385 |
387 assert(gc_timer.gc_end() == 2, "Incorrect"); |
386 assert(gc_timer.gc_end() == Ticks(2), "Incorrect"); |
388 } |
387 } |
389 }; |
388 }; |
390 |
389 |
391 void GCTimer_test() { |
390 void GCTimer_test() { |
392 GCTimerTest::all(); |
391 GCTimerTest::all(); |