28 #ifndef V8_PLATFORM_ELAPSED_TIMER_H_
29 #define V8_PLATFORM_ELAPSED_TIMER_H_
31 #include "../checks.h"
40 ElapsedTimer() : started_(
false) {}
59 start_ticks_ = TimeTicks();
68 ASSERT(started_ || start_ticks_.IsNull());
69 ASSERT(!started_ || !start_ticks_.IsNull());
70 return !start_ticks_.IsNull();
80 TimeTicks ticks = Now();
81 TimeDelta elapsed = ticks - start_ticks_;
82 ASSERT(elapsed.InMicroseconds() >= 0);
92 TimeDelta elapsed = Now() - start_ticks_;
93 ASSERT(elapsed.InMicroseconds() >= 0);
102 return Elapsed() >= time_delta;
107 TimeTicks now = TimeTicks::HighResolutionNow();
112 TimeTicks start_ticks_;
120 #endif // V8_PLATFORM_ELAPSED_TIMER_H_
bool HasExpired(TimeDelta time_delta) const
#define ASSERT(condition)
TimeDelta Elapsed() const