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

Side by Side Diff: base/message_loop/message_pump_perftest.cc

Issue 812543002: Update from https://crrev.com/308331 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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 unified diff | Download patch
« no previous file with comments | « base/message_loop/message_loop.cc ('k') | base/message_loop/message_pump_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/bind.h" 5 #include "base/bind.h"
6 #include "base/format_macros.h" 6 #include "base/format_macros.h"
7 #include "base/memory/scoped_vector.h" 7 #include "base/memory/scoped_vector.h"
8 #include "base/strings/stringprintf.h" 8 #include "base/strings/stringprintf.h"
9 #include "base/synchronization/condition_variable.h" 9 #include "base/synchronization/condition_variable.h"
10 #include "base/synchronization/lock.h" 10 #include "base/synchronization/lock.h"
(...skipping 21 matching lines...) Expand all
32 base::TimeTicks start = base::TimeTicks::HighResNow(); 32 base::TimeTicks start = base::TimeTicks::HighResNow();
33 base::TimeTicks thread_start; 33 base::TimeTicks thread_start;
34 if (TimeTicks::IsThreadNowSupported()) 34 if (TimeTicks::IsThreadNowSupported())
35 thread_start = base::TimeTicks::ThreadNow(); 35 thread_start = base::TimeTicks::ThreadNow();
36 base::TimeDelta minimum = base::TimeDelta::Max(); 36 base::TimeDelta minimum = base::TimeDelta::Max();
37 base::TimeDelta maximum = base::TimeDelta(); 37 base::TimeDelta maximum = base::TimeDelta();
38 base::TimeTicks now, lastnow = start; 38 base::TimeTicks now, lastnow = start;
39 uint64_t schedule_calls = 0u; 39 uint64_t schedule_calls = 0u;
40 do { 40 do {
41 for (size_t i = 0; i < kBatchSize; ++i) { 41 for (size_t i = 0; i < kBatchSize; ++i) {
42 target_message_loop()->ScheduleWork(true); 42 target_message_loop()->ScheduleWork();
43 schedule_calls++; 43 schedule_calls++;
44 } 44 }
45 now = base::TimeTicks::HighResNow(); 45 now = base::TimeTicks::HighResNow();
46 base::TimeDelta laptime = now - lastnow; 46 base::TimeDelta laptime = now - lastnow;
47 lastnow = now; 47 lastnow = now;
48 minimum = std::min(minimum, laptime); 48 minimum = std::min(minimum, laptime);
49 maximum = std::max(maximum, laptime); 49 maximum = std::max(maximum, laptime);
50 } while (now - start < base::TimeDelta::FromSeconds(kTargetTimeSec)); 50 } while (now - start < base::TimeDelta::FromSeconds(kTargetTimeSec));
51 51
52 scheduling_times_[index] = now - start; 52 scheduling_times_[index] = now - start;
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 TEST_F(PostTaskTest, TenTasksPerReload) { 284 TEST_F(PostTaskTest, TenTasksPerReload) {
285 Run(10000, 10); 285 Run(10000, 10);
286 } 286 }
287 287
288 TEST_F(PostTaskTest, OneHundredTasksPerReload) { 288 TEST_F(PostTaskTest, OneHundredTasksPerReload) {
289 Run(1000, 100); 289 Run(1000, 100);
290 } 290 }
291 291
292 } // namespace 292 } // namespace
293 } // namespace base 293 } // namespace base
OLDNEW
« no previous file with comments | « base/message_loop/message_loop.cc ('k') | base/message_loop/message_pump_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698