1 // Copyright 2013 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.
5 #ifndef UI_GFX_FRAME_TIME_H
6 #define UI_GFX_FRAME_TIME_H
8 #include "base/time/time.h"
9 #include "base/logging.h"
13 // FrameTime::Now() should be used to get timestamps with a timebase that
14 // is consistent across the graphics stack.
17 static base::TimeTicks
Now() {
18 return base::TimeTicks::Now();
22 static base::TimeTicks
FromQPCValue(LONGLONG qpc_value
) {
23 DCHECK(TimestampsAreHighRes());
24 return base::TimeTicks::FromQPCValue(qpc_value
);
28 static bool TimestampsAreHighRes() {
30 return base::TimeTicks::IsHighResolution();
32 // TODO(miu): Mac/Linux always provide high-resolution timestamps. Consider
33 // returning base::TimeTicks::IsHighResolution() for all platforms.
41 #endif // UI_GFX_FRAME_TIME_H