Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

More granularity with my timer (under Linux)

Status
Not open for further replies.

Ezequiel

Programmer
Apr 4, 2001
30
CA
I'm using the clock() function in my C++ program.

The problem is: I'm getting times like 0, 10 ms, 20 ms, etc.

But... what if a part of the program takes 5 ms, 15 ms, or 25 ms, or even more odd values like 7 ms, 11 ms, 12 ms, etc.

Is there a way to modify the intervals to let me measure the time with more precision?

Thanks in advance!
Eze.
eze@bumeran.com ---
Ezequiel Glinsky
eze@bumeran.com
Buenos Aires, Argentina
 
You need POSIX calls which do not exist in standard LINUX. Look into real-time linux which support the fast clocks and timers.

Brudnak
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top