当前位置:   article > 正文

Chromium入坑之旅:base库之timer时间操作学习_chromium base

chromium base

base::TimeDelta

s=秒,ms=毫秒,us=微秒,ns=纳秒;
1s=1000ms=1000000us=1000000000ns;

int main() {
	std::cout << "------TimeDelta------\n";

	std::cout << L"FromDays(天):" << base::TimeDelta::FromDays(1)<<"\n";
	
	std::cout << L"FromHours(小时):" << base::TimeDelta::FromHours(1)  << "\n";
	
	std::cout << L"FromInternalValue(微秒):" << base::TimeDelta::FromInternalValue(1000000) << "已弃用\n";
	
	std::cout << L"FromMicroseconds(微秒):" << base::TimeDelta::FromMicroseconds(1000000) << "\n";
	std::cout << L"FromMicrosecondsD(微秒):" << base::TimeDelta::FromMicrosecondsD(1000000) << "\n";
	
	std::cout << L"FromMilliseconds(毫秒):" << base::TimeDelta::FromMilliseconds(1000) << "\n";
	std::cout << L"FromMillisecondsD(毫秒):" << base::TimeDelta::FromMillisecondsD(1000) << "\n";
	
	std::cout << L"FromMinutes(分):" << base::TimeDelta::FromMinutes(1) << "\n";
	
	std::cout << L"FromNanoseconds(纳秒):" << base::TimeDelta::FromNanoseconds(1000000000) << "\n";
	std::cout << L"FromNanosecondsD(纳秒):" << base::TimeDelta::FromNanosecondsD(1000000000) << "\n";

	std::cout << L"FromSeconds(秒):" << base::TimeDelta::FromSeconds(1) << "\n";
	std::cout << L"FromSecondsD(秒):" << base::TimeDelta::FromSecondsD(1) << "\n";
	
	std::cout << L"Max: " << base::TimeDelta::Max() << "\n";
	std::cout << L"Min: " << base::TimeDelta::Min() << "\n";
	
	//std::cout << "FromQPCValue:1 " << base::TimeDelta::FromQPCValue(1) << "\n";
	//std::cout << base::TimeDelta::FromWinrtDateTime() << "\n";
	//std::cout << "FromFileTime:" << base::TimeDelta::FromFileTime() << "\n";
	
	char* cData = new char[256];
	std::cin >> cData;
	base::AtExitManager ax;

	return 0;
}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Gausst松鼠会/article/detail/211449
推荐阅读
相关标签
  

闽ICP备14008679号