Project Home
Project Home
Trackers
Trackers
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
BroadcastCommunity.qnx.com will be offline from May 31 6:00pm until June 2 12:00AM for upcoming system upgrades. For more information please go to https://community.qnx.com/sf/discussion/do/listPosts/projects.bazaar/discussion.bazaar.topc28418
Forum Topic - Queries related to clock() call: (3 Items)
   
Queries related to clock() call  
I am using clock() system call to measure the performance and I have the following queries,

1. Does it give accurate results ?
2. I am running the executable on 600MHz processor, does the ticks returned by clock () function is accurate to this 
processor ?

This is really important for us ...
Re: Queries related to clock() call  
I don't know what clock() does. The highest resolution counter used be IDE Profiling tools is ClockCycles()

On 26/10/10 09:41 AM, Girisha SG wrote:
> I am using clock() system call to measure the performance and I have the following queries,
> 
> 1. Does it give accurate results ?
> 2. I am running the executable on 600MHz processor, does the ticks returned by clock () function is accurate to this 
processor ?
> 
> This is really important for us ...
> 
> 
> 
> _______________________________________________
> 
> General
> http://community.qnx.com/sf/go/post72395
> 
RE: Queries related to clock() call  
6.5.0 docs:
http://www.qnx.com/developers/docs/6.5.0/topic/com.qnx.doc.neutrino_lib_ref/c/clock.html <http://www.qnx.com/developers/
docs/6.5.0/topic/com.qnx.doc.neutrino_lib_ref/c/clock.html>; 
 
"Return the number of clock ticks used by the program"

note also:
"
In a multithreaded program, clock() returns the time used by all threads in the application; clock() returns the time 
since the program started, not the time since a specific thread started. 
"
 
It may well be that you want to use ClockCycles(), as Elena suggested.
 
As for accuracy, I believe it should be accurate, yes. Is there something that makes you think it is not ?
 
For a 2nd opinion, consider using an instrumented kernel, and capture a system trace (kev file) and examine it to verify
 the timings. Or, there's always the classic 'write to a GPIO' and capture the output on an oscilloscope.
 
Regards
 
Dave



_______________________________________________

General
http://community.qnx.com/sf/go/post72399 <http://community.qnx.com/sf/go/post72399>; 


Attachment: Text winmail.dat 4.31 KB