[Qt-interest] Monotonic clock in Qt?
Nikos Chantziaras
realnc at arcor.de
Wed May 5 12:09:10 CEST 2010
On 05/05/2010 12:47 PM, Pau Garcia i Quiles wrote:
> On Tue, May 4, 2010 at 9:46 PM, Nikos Chantziaras<realnc at arcor.de> wrote:
>> I need to do time measurements, and I use QTime for this.
>> Unfortunately, QTime is not "solid" for this. If the system clock gets
>> changed, I'm screwed.
>
> Can't you use QTimer for that? On Unix it uses a monotonic clock, on
> Windows it counts events. It works fine even if you change the system
> time.
I can't think of a way to do that, since QTimer doesn't provide a way to
query it for any kind of elapsed time.
It seems the only way to do that is what Diego and Thiago suggested.
It's a bit surprising though that it took the Trolls to reach Qt 4.7
until the need for a monotonic clock became apparent :P
More information about the Qt-interest-old
mailing list