OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef MOJO_PUBLIC_C_ENVIRONMENT_TESTS_ASYNC_WAITER_PERFTEST_HELPERS_H_ |
| 6 #define MOJO_PUBLIC_C_ENVIRONMENT_TESTS_ASYNC_WAITER_PERFTEST_HELPERS_H_ |
| 7 |
| 8 #include <stdint.h> |
| 9 |
| 10 #include <functional> |
| 11 |
| 12 #include "mojo/public/c/environment/async_waiter.h" |
| 13 |
| 14 namespace mojo { |
| 15 namespace test { |
| 16 |
| 17 // Basic single-threaded perf test helper for |MojoAsyncWaiter|. This will keep |
| 18 // |num_handles| active async waits and activate them one at a time (with each |
| 19 // callback triggering the next). This sets up the test (setting up the initial |
| 20 // set of async waits), calls |run_loop_function|, and once that is done cleans |
| 21 // up. It returns the number of async waits completed. |run_loop_function| |
| 22 // should typically run the message/run loop and quit after some fixed amount of |
| 23 // time (it should probably measure the actual amount of time spent running, and |
| 24 // the return value should probably be normalized with respect to that). |
| 25 uint64_t DoAsyncWaiterPerfTest(const MojoAsyncWaiter* async_waiter, |
| 26 uint32_t num_handles, |
| 27 std::function<void()> run_loop_function); |
| 28 |
| 29 } // namespace test |
| 30 } // namespace mojo |
| 31 |
| 32 #endif // MOJO_PUBLIC_C_ENVIRONMENT_TESTS_ASYNC_WAITER_PERFTEST_HELPERS_H_ |
OLD | NEW |