// Copyright 2019 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "base/timer/lap_timer.h" #include "base/test/task_environment.h" #include "base/time/time.h" #include "build/build_config.h" #include "testing/gtest/include/gtest/gtest.h" // This file contains a minimal unit test for LapTimer, used for benchmarking. // This file is supposed to match closely with the example code, documented in // lap_timer.h. Please update that documentation if you need to change things. namespace base { namespace test { namespace { constexpr base::TimeDelta kTimeLimit = …; constexpr base::TimeDelta kTimeAdvance = …; constexpr int kWarmupRuns = …; constexpr int kTimeCheckInterval = …; } // namespace TEST(LapTimer, UsageExample) { … } #if !BUILDFLAG(IS_IOS) // iOS simulator does not support using ThreadTicks. TEST(LapTimer, ThreadTicksUsageExample) { … } #endif } // namespace test } // namespace base