Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

linux 和 windwos 时钟精度的差别 #6

Open
tnie opened this issue Apr 10, 2018 · 0 comments
Open

linux 和 windwos 时钟精度的差别 #6

tnie opened this issue Apr 10, 2018 · 0 comments

Comments

@tnie
Copy link
Owner

tnie commented Apr 10, 2018

在 widows 下发现 system_clock 的精度介于纳秒和微秒之间,怪纠结的。

#define _XTIME_NSECS_PER_TICK	100
#define _XTIME_TICKS_PER_TIME_T	(long long)10000000

struct system_clock
{	// wraps GetSystemTimePreciseAsFileTime/GetSystemTimeAsFileTime
	typedef long long rep;
	typedef ratio_multiply<ratio<_XTIME_NSECS_PER_TICK, 1>, nano> period;

我觉得 linux 不会做这种蛋疼的事情(尚未验证),所以 linux 和 windows 的时钟精度可能就会有差异了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant