YSTest: YClock.h 源文件

YSTest PreAlpha_b700_20160611 The YSLib Test Project

- 首页
- 相关页面
- 模块
- 命名空间
- 类
- 文件

- 文件列表
- 文件成员

YClock.h
浏览该文件的文档.
1 /*
2 © 2012-2015 FrankHB.
3
4 This file is part of the YSLib project, and may only be used,
5 modified, and distributed under the terms of the YSLib project
6 license, LICENSE.TXT. By continuing to use, modify, or distribute
7 this file you indicate that you have read the license and
8 understand and accept it fully.
9 */
10
28 #ifndef YSL_INC_Core_YClock_h_
29 #define YSL_INC_Core_YClock_h_ 1
30
31 #include "YModules.h"
32 #include YFM_YSLib_Core_YShellDefinition
33 #include <chrono>
34
35 namespace YSLib
36 {
37
38 namespace Timers
39 {
40
45 class YF_API HighResolutionClock
46 {
47 public:
48 using duration = std::chrono::duration<
49 ystdex::make_signed_t<std::chrono::nanoseconds::rep>, std::nano>;
50 using rep = duration::rep;
51 using period = duration::period;
52 using time_point = std::chrono::time_point<HighResolutionClock,
53 std::chrono::nanoseconds>;
54
55 static yconstexpr const bool is_steady = {};
56
58 static PDefH(time_point, now, ) ynothrow
59 ImplRet(time_point(std::chrono::nanoseconds(GetHighResolutionTicks())))
60 };
61
62
68 using Duration = HighResolutionClock::duration;
69
74 using TimePoint = HighResolutionClock::time_point;
75
81 using TimeSpan = std::chrono::duration<Duration::rep, std::milli>;
82
83 } // namespace Timers;
84
85 } // namespace YSLib;
86
87 #endif
88
YSLib::Timers::HighResolutionClock
高精度时钟。
Definition: YClock.h:45
yconstexpr
#define yconstexpr
指定编译时常量表达式。
Definition: ydef.h:653
YSLib::Timers::HighResolutionClock::period
duration::period period
Definition: YClock.h:51
Timers
YModules.h
YSLib::Timers::HighResolutionClock::time_point
std::chrono::time_point< HighResolutionClock, std::chrono::nanoseconds > time_point
Definition: YClock.h:53
YSLib::Timers::HighResolutionClock::duration
std::chrono::duration< ystdex::make_signed_t< std::chrono::nanoseconds::rep >, std::nano > duration
Definition: YClock.h:49
YSLib
YSLib 命名空间。
Definition: AndroidHost.h:45
YSLib::PDefH
PDefH(Environment &, FetchEnvironment,) ImplRet(FetchGlobalInstance().GetEnvironmentRef()) inline PDefH(GUIHost &
取单一环境对象引用。
YSLib::Timers::Duration
HighResolutionClock::duration Duration
高精度时间间隔。
Definition: YClock.h:68
YSLib::ynothrow
YB_PURE const _type size_t n ynothrow
Definition: YCoreUtilities.h:168
YSLib::Timers::TimePoint
HighResolutionClock::time_point TimePoint
时刻。
Definition: YClock.h:74
YSLib::Timers::TimeSpan
std::chrono::duration< Duration::rep, std::milli > TimeSpan
低精度时间间隔。
Definition: YClock.h:81
std
Definition: memory.hpp:1100
platform::GetHighResolutionTicks
YF_API std::uint64_t GetHighResolutionTicks() ynothrow
取高精度 tick 数。
Definition: Timer.cpp:88
YF_API
#define YF_API
Definition: Platform.h:56
YSLib::ImplRet
ImplRet(FetchGlobalInstance().GetGUIHostRef()) YF_API void Execute(GUIApplication &
执行程序主消息循环。
YSLib::Timers::HighResolutionClock::rep
duration::rep rep
Definition: YClock.h:50