![]() |
|
#1
|
|||
|
|||
Click TicksEDIT: Err, CLOCK ticks, not click ticks for the subject title.
I am trying to get the amount of clock ticks that takes a certain part of my program to run. For example: CPP / C++ / C Code:
However! I am also using the wall clock as well as the CPU clock. So I have 2 different timers to see how my code compares. The wall clock time works fine but the clock tick code does not. This is the code for that: CPP / C++ / C Code:
When I run the program and it displays both times (wall clock and claimed "CPU milli-second"code), interesting things happen... They both are the same! Shouldn't the CPU one be different, and much higher? Anyways, here is the layout for my program: CPP / C++ / C Code:
When I run the above with a small data file I have this: Quote:
I find it hard to believe that it took the CPU 0 time to process this information even though it took less then a second. On a larger data file: Quote:
CPU and the wall clock time appear to be equal, which leads me to believe that this is incorrect. If anyone has some information regarding what is incorrect above would be good. Thanks |
|
#2
|
|||
|
|||
Re: Clock TicksQuote:
What you're looking for is a "high resolution" timer. This is a fundamental weakness of C/C++ in that in order to remain portable, the scope of resolution is limited to a "lowest-common-denominator." In C, we're at a microsecond resolution at best. ...here is a quick hack that may tell you what you want to know: CPP / C++ / C Code:
:davis: |
Recent GIDBlog
Meeting the populace by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Ads - - - what if I click on my website?? | wish71 | AdSense Forum | 11 | 03-Jul-2007 20:59 |
| Re: AdSense, now you can click them on your site | JdS | AdSense Forum | 12 | 19-Feb-2006 15:11 |
| how click in my ads | saracool | AdSense Forum | 4 | 19-Feb-2006 13:45 |
| Sydog's DVD to Divx Conversion Guide | asanthadenz | Computer Software Forum - Windows | 1 | 14-Mar-2003 14:08 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The