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

Side by Side Diff: components/scheduler/renderer/coarse_duration_timer.h

Issue 1898233002: Report expected task queueing time via UMA (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Super rough alternative approach. Created 4 years, 6 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
(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 COMPONENTS_SCHEDULER_RENDERER_COARSE_DURATION_TIMER_H_
6 #define COMPONENTS_SCHEDULER_RENDERER_COARSE_DURATION_TIMER_H_
7
8 #include "base/message_loop/message_loop.h"
9 #include "base/optional.h"
10 #include "base/time/time.h"
11
12 namespace scheduler {
13
14 // TODO - add locking things.
tdresser 2016/05/30 19:07:46 ^
15 class CoarseDurationTimer : public base::MessageLoop::RecentTimeObserver {
16 public:
17 // RecentTimeObserver implementation:
18 void OnUpdateRecentTime(base::TimeTicks time) override;
19
20 void BeginInterval();
21 base::TimeDelta EndInterval();
22 base::TimeTicks most_recent_time() { return most_recent_time_; }
23
24 private:
25 enum class State {
26 OUTSIDE_INTERVAL,
27 WITHIN_INTERVAL_NEEDS_START,
28 WITHIN_INTERVAL
29 };
30
31 State state_;
32 base::TimeTicks start_time_;
33 base::TimeTicks most_recent_time_;
34 };
35
36 } // namespace scheduler
37
38 #endif // COMPONENTS_SCHEDULER_RENDERER_COARSE_DURATION_TIMER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698