cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Explorer
Explorer
8,089 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
Highlighted
Teacher
Teacher
7,998 Views
Registered: ‎03-31-2012

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
Highlighted
Explorer
Explorer
7,972 Views
Registered: ‎07-30-2009

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

0 Kudos