Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(931)

Unified Diff: test/cctest/test-log.cc

Issue 115918: Use uint in ProfLazyMode test when measuring time delta. (Closed)
Patch Set: Created 11 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-log.cc
diff --git a/test/cctest/test-log.cc b/test/cctest/test-log.cc
index aca9492b0461b847f01f199cdfd2679bd99a0865..005be475ecab551e416cc20d6196a6fb5debbe77 100644
--- a/test/cctest/test-log.cc
+++ b/test/cctest/test-log.cc
@@ -166,9 +166,11 @@ 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.
- const int64_t started_us = i::OS::Ticks();
- while (i::OS::Ticks() - started_us < 200 * 1000) {
+ // 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) {
William Hesse 2009/05/29 12:19:49 The condition should really be (ended_us = ticks()
William Hesse 2009/05/29 12:55:32 Actually, we don't really understand what is going
CompileAndRunScript(script_src.start());
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698