views:

108

answers:

1

Hello. I want to write simple application in C++ using ctime library. 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. This app will be used on Linux OS.

A: 

POSIX has the clock_gettime() function, that lets you access a monotonic clock (using CLOCK_MONOTONIC.)

ninjalj
Thank you for answer :-) It was very helpful.