P
Peger, Daniel H.
Hi,
I'm having a slight problem with the precision of the standard c++ clock
function as it is defined in time.h .
On my system the shortest meassurable time period is 0.01 seconds, but for
my programm I need to meassure the processing time in ms.
Is there perhaps something like an environment variable controlling the
precision of clock(), or is there any other way of meassuring time in ANSI
C in the ms domain??
Could running the code on a notebook with speedstep cause problems?? Idle
CPU-Freq is 600MHz and 100% is 1500MHz?
Regards, Daniel.
My code looks like this:
void test() {
for ( int i = 0; i<10000; i++) {
cout << "clock() = " << clock() << "\n";
}
}
and the output:
....
clock() = 190000
clock() = 190000
clock() = 200000
clock() = 200000
clock() = 200000
clock() = 200000
clock() = 200000
clock() = 200000
....
clock() = 210000
I'm having a slight problem with the precision of the standard c++ clock
function as it is defined in time.h .
On my system the shortest meassurable time period is 0.01 seconds, but for
my programm I need to meassure the processing time in ms.
Is there perhaps something like an environment variable controlling the
precision of clock(), or is there any other way of meassuring time in ANSI
C in the ms domain??
Could running the code on a notebook with speedstep cause problems?? Idle
CPU-Freq is 600MHz and 100% is 1500MHz?
Regards, Daniel.
My code looks like this:
void test() {
for ( int i = 0; i<10000; i++) {
cout << "clock() = " << clock() << "\n";
}
}
and the output:
....
clock() = 190000
clock() = 190000
clock() = 200000
clock() = 200000
clock() = 200000
clock() = 200000
clock() = 200000
clock() = 200000
....
clock() = 210000