1 // Copyright 2021 The Chromium Authors 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #include "base/power_monitor/timer_sampling_event_source.h" 6 7 #include "base/check.h" 8 9 namespace base { 10 TimerSamplingEventSource(TimeDelta interval)11TimerSamplingEventSource::TimerSamplingEventSource(TimeDelta interval) 12 : interval_(interval) {} 13 14 TimerSamplingEventSource::~TimerSamplingEventSource() = default; 15 Start(SamplingEventCallback callback)16bool TimerSamplingEventSource::Start(SamplingEventCallback callback) { 17 DCHECK(callback); 18 timer_.Start(FROM_HERE, interval_, std::move(callback)); 19 return true; 20 } 21 22 } // namespace base 23