precise time measuring
-
hi there i have been working on a mathematical program, and i need some way to measure elapsed time between 2 operations precisely (if possible, as precise as sciencemark has in its primordia benchmark: www.sciencemark.org), but i dont like just going out and using some third party class... right now I am able to measure "only" up to miliseconds... thanx Thiago
-
hi there i have been working on a mathematical program, and i need some way to measure elapsed time between 2 operations precisely (if possible, as precise as sciencemark has in its primordia benchmark: www.sciencemark.org), but i dont like just going out and using some third party class... right now I am able to measure "only" up to miliseconds... thanx Thiago
Given that Windows is not a resal-time OS, much precision is not going to be a reality. Depending on your OS (e.g., 9x, NT), the timer resolution will range from 10ms to 55ms. Read this site for more.
Five birds are sitting on a fence. Three of them decide to fly off. How many are left?
-
hi there i have been working on a mathematical program, and i need some way to measure elapsed time between 2 operations precisely (if possible, as precise as sciencemark has in its primordia benchmark: www.sciencemark.org), but i dont like just going out and using some third party class... right now I am able to measure "only" up to miliseconds... thanx Thiago
A common trick is to measure multiple executions of a function and then calculate the execution time from the result. For example, you could run your functions 100,000 times. Then you divide the result by 100,000 to get the time for a single execution. Off course a lot of things can and do go wrong with this. On Windows you will not get really good data for many reasons. But this method produces an upper bound of maybe higher precision than what you have now. Lorenz Prem Microsoft Corporation