UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Explorer
Explorer
7,950 Views
Registered: ‎07-30-2009

time.h question

so i'm using time.h to measure program time running on petalinux zynq

 

begin = clock();

 

program etc

 

end = clock();

time_spent = (double)(end - begin) / CLOCKS_PER_SEC;

the CLOCKS_PER_SEC =1000000

 

is CLOCKS_PER_SEC correct for any system or i need divide by some new number?

0 Kudos
2 Replies
Teacher muzaffer
Teacher
7,859 Views
Registered: ‎03-31-2012

Re: time.h question

I would think clocks per second depends on the cpu frequency so you need to scale it with it to get actual times.
- Please mark the Answer as "Accept as solution" if information provided is helpful.
Give Kudos to a post which you think is helpful and reply oriented.
0 Kudos
Explorer
Explorer
7,833 Views
Registered: ‎07-30-2009

Re: time.h question

yea but zynq cpu is running at 667mhz, if i use that my dma time just dont look right, much too small.

0 Kudos