Index: test/cctest/test-log.cc |
diff --git a/test/cctest/test-log.cc b/test/cctest/test-log.cc |
index 005be475ecab551e416cc20d6196a6fb5debbe77..f3f7efc710b99091c6e1e268acfc12ff09477c5f 100644 |
--- a/test/cctest/test-log.cc |
+++ b/test/cctest/test-log.cc |
@@ -166,17 +166,19 @@ static int CheckThatProfilerWorks(int log_pos) { |
"for (var i = 0; i < 1000; ++i) { " |
"(function(x) { return %d * x; })(i); }", |
log_pos); |
- // Run code for 200 msecs to get some ticks. Use uint to always have |
- // non-negative delta. |
- const uint64_t started_us = i::OS::Ticks(); |
- uint64_t delta; |
- while ((delta = i::OS::Ticks() - started_us) < 200 * 1000) { |
+ // Run code for 200 msecs to get some ticks. |
+ const double end_time = i::OS::TimeCurrentMillis() + 200; |
+ while (i::OS::TimeCurrentMillis() < end_time) { |
CompileAndRunScript(script_src.start()); |
} |
Logger::PauseProfiler(); |
CHECK(!LoggerTestHelper::IsSamplerActive()); |
+ // Wait 50 msecs to allow Profiler thread to process the last |
+ // tick sample it has got. |
+ i::OS::Sleep(50); |
+ |
// Now we must have compiler and tick records. |
int log_size = GetLogLines(log_pos, &buffer); |
printf("log_size: %d\n", log_size); |