Nios® II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
Intel Support hours are Monday-Fridays, 8am-5pm PST, except Holidays. Thanks to our community members who provide support during our down time or before we get to your questions. We appreciate you!

Need Forum Guidance? Click here
Search our FPGA Knowledge Articles here.
12434 Discussions

Record execution time in nios ii

Honored Contributor II



I have a custom component in my qsys project and I want to record the processing time in the component by using 'clock()' in the nios C code. 

The problem is whenever I add these lines:  



'begin = clock()',  

'end = clock()',  

'time = (end-begin) / CLOCKS_PER_SEC'  


to the code, the ELF downloading will fail. 

Any suggestion why this happens and any alternative way I can record the execution time for my component? 


0 Kudos
1 Reply
Honored Contributor II

I've never used clock() in NIOS, and I don't see why ELF downloading would fail because of the snippet you posted. 


However, I would recommend reading this appnote: 


In particular, the piece on the Performance Counter starting on page 11.