简体   繁体   English

C ++和CTime与系统时钟更改

[英]C++ and CTime & System clock changing

I want to write simple application in C++ using ctime library. 我想使用ctime库在C ++中编写简单的应用程序。 I'm getting the actual time and do some calculation in the loop. 我正在获取实际时间并在循环中进行一些计算。 Very important for me is the fact that user can modify OS clock during calculations. 对我来说非常重要的事实是,用户可以在计算过程中修改操作系统时钟。 Is there any way to get to know inside my app if the user has changed OS clock? 如果用户更改了操作系统时钟,是否可以通过任何方式了解我的应用程序?

Thnx for help in advance. 提前寻求帮助。

PS. PS。 This app will be used on Linux OS. 该应用程序将在Linux OS上使用。

POSIX具有clock_gettime()函数,使您可以访问单调时钟(使用CLOCK_MONOTONIC。)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM