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

Side by Side Diff: mojo/public/c/system/tests/perftest_utils.h

Issue 2141083003: Add a perf test for async wait and fix a bug in mojo::RunLoop. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: oops Created 4 years, 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 //
5 // Note: This header should be compilable as C.
6 4
7 #ifndef MOJO_PUBLIC_C_SYSTEM_TESTS_PERFTEST_UTILS_H_ 5 #ifndef MOJO_PUBLIC_C_SYSTEM_TESTS_PERFTEST_UTILS_H_
8 #define MOJO_PUBLIC_C_SYSTEM_TESTS_PERFTEST_UTILS_H_ 6 #define MOJO_PUBLIC_C_SYSTEM_TESTS_PERFTEST_UTILS_H_
9 7
10 #include <functional> 8 #include <functional>
11 9
12 #include "mojo/public/c/system/time.h" 10 #include "mojo/public/c/system/time.h"
13 11
14 namespace mojo { 12 namespace mojo {
15 namespace test { 13 namespace test {
16 14
17 // How long to run each perf test for (in microseconds). 15 // How long to run each perf test for (in microseconds).
18 constexpr MojoTimeTicks kPerftestTimeMicroseconds = 3 * 1000000; 16 constexpr MojoTimeTicks kPerftestTimeMicroseconds = 3 * 1000000;
19 17
20 // Iterates the given function for |kPerftestTimeMicroseconds| and reports the 18 // Iterates the given function for |kPerftestTimeMicroseconds| and reports the
21 // number of iterations executed per second. 19 // number of iterations executed per second.
22 void IterateAndReportPerf(const char* test_name, 20 void IterateAndReportPerf(const char* test_name,
23 const char* sub_test_name, 21 const char* sub_test_name,
24 std::function<void()> single_iteration); 22 std::function<void()> single_iteration);
25 23
26 // Sleeps for the given amount of time (in microseconds). 24 // Sleeps for the given amount of time (in microseconds).
27 void Sleep(MojoTimeTicks microseconds); 25 void Sleep(MojoTimeTicks microseconds);
28 26
29 } // namespace test 27 } // namespace test
30 } // namespace mojo 28 } // namespace mojo
31 29
32 #endif // MOJO_PUBLIC_C_SYSTEM_TESTS_PERFTEST_UTILS_H_ 30 #endif // MOJO_PUBLIC_C_SYSTEM_TESTS_PERFTEST_UTILS_H_
OLDNEW
« no previous file with comments | « mojo/public/c/environment/tests/async_waiter_perftest_helpers.cc ('k') | mojo/public/cpp/environment/tests/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698