On Windows, clock()
returns the time in milliseconds, but on this Linux box I'm working on, it rounds it to the nearest 1000 so the precision is only to the "second" level and not to the milliseconds level.
I found a solution with Qt using the QTime
class, instantiating an object and calling start()
on it then calling elapsed()
to get the number of milliseconds elapsed.
I got kind of lucky because I'm working with Qt to begin with, but I'd like a solution that doesn't rely on third party libraries,
Is there no standard way to do this?
UPDATE
Please don't recommend Boost ..
If Boost and Qt can do it, surely it's not magic, there must be something standard that they're using!
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…