Correct BM_ShellInitializationAndShutdown (#18829)

This commit is contained in:
liyuqian 2020-06-16 23:38:02 -07:00 committed by GitHub
parent 43ad8347e1
commit 137320b5c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -70,7 +70,11 @@ static void StartupAndShutdownShell(benchmark::State& state,
// The ui thread could be busy processing tasks after shell created, e.g.,
// default font manager setup. The measurement of shell shutdown should be
// considered after those ui tasks have been done.
benchmarking::ScopedPauseTiming pause(state, true);
//
// However, if we're measuring the complete time from startup to shutdown,
// this time should still be included.
benchmarking::ScopedPauseTiming pause(
state, !measure_shutdown || !measure_startup);
fml::AutoResetWaitableEvent latch;
fml::TaskRunner::RunNowOrPostTask(thread_host->ui_thread->GetTaskRunner(),
[&latch]() { latch.Signal(); });