time.time() strangeness

N

Nitro

The granularity of time.time can be quite large, maybe as much
as 1 second in some systems. Also, if the user can set the time,
the output might not be monotone. They might set the clock backwards
if it has drifted ahead, or something like that. Better to use an
explicit counter if you need a monotonically increasing sequence.

It's not the granularity, after all it works without the single
CreateDevice. With the line uncommented the value doesn't even change
after 2 minutes.
I am not sure what you mean with explicit counter. I think I would still
need to get some time delta to accumulate. However, time.time() -
time.time() will always be 0 for obvious reasons.
I agree it would probably be better to use time.clock() and an explicit
counter to prevent time wrapping issues. Nevertheless time.time()
shouldn't fail here unless DirectX is really badly tinkering with my
system.

Thanks for your answer,
-Matthias
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top