Computing time response of Resource Manager

What’s a good way to check the response of my resource manager.
I did it this way and the start time and end time are equal.

start_time=clock();
ret=devctl(fd,MY_DEV_MSG, %arg, sizeof(arg), NULL);
end_time=clock();

Since start_time=end_time does that mean that the OS didn’t update the
clock? If this way won’t work, what is a good way?

Chris Rose <chris.rose@viasat.com> wrote:

What’s a good way to check the response of my resource manager.
I did it this way and the start time and end time are equal.

start_time=clock();
ret=devctl(fd,MY_DEV_MSG, %arg, sizeof(arg), NULL);
end_time=clock();

Since start_time=end_time does that mean that the OS didn’t update the
clock? If this way won’t work, what is a good way?

All it means is that it took less than one second :slight_smile:

Try “ClockCycles()”, it’ll give you a way more accurate snapshot.
Do this in a loop and average it out, taking note of min/max.

Cheers,
-RK


Robert Krten, PARSE Software Devices +1 613 599 8316.
Realtime Systems Architecture, Books, Video-based and Instructor-led
Training and Consulting at www.parse.com.
Email my initials at parse dot com.

“Chris Rose” <chris.rose@viasat.com> wrote in message
news:a4h6ev$ll6$1@inn.qnx.com

What’s a good way to check the response of my resource manager.
I did it this way and the start time and end time are equal.

start_time=clock();
ret=devctl(fd,MY_DEV_MSG, %arg, sizeof(arg), NULL);
end_time=clock();

clock resolution is the ticksize (1ms on >40Mzh), hence in your case
it means it took less then 1ms :wink:

Since start_time=end_time does that mean that the OS didn’t update the
clock? If this way won’t work, what is a good way?

As Robert suggested use ClockCycles() but beware than on < Pentium,
ClockCycles resolution is == to ticksize