Is there a better function or way to measure time than clock()
function on Windows? I have a short operation and when I try clock()
or gettickcount()
it says it took 0.0 seconds. I need a way to measure it by miliseconds or nanoseconds.
相关问题
- Multiple sockets for clients to connect to
- What is the best way to do a search in a large fil
- Inheritance impossible in Windows Runtime Componen
- glDrawElements only draws half a quad
- how to get running process information in java?
You can use
QueryPerformanceCounter
andQueryPerformanceFrequency
:You can use QueryPerformanceCounter combined with QueryPerformanceFrequency to get nanosecond precision.