- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm trying to measure the time taken in seconds for a section of my c-code to execute. I've followed the instructions from the Nios handbook - Chapter 6 - Example 6-9 as below
if (alt_timestamp_start()< 0)
{
printf ("No timestamp device is available.\n");
}
time1 = alt_timestamp();
func(); //function being monitored
time2 = alt_timestamp();
printf("timestamp value = %u ticks\n",
(unsigned int) (time2 - time1));
If I want to get the actual time taken in seconds, do I just divide the timestamp value by alt_timestamp_freq()? I have added the Interval Timer component in SOPC with default parameters. How do these parameters affect my actual time? I read the 'Interval Timer Core' documentation but I am not sure if I have to change any setting for my usage.
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
OK, I found what I was looking for. Please ignore post above. Sorry.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Could you please show me how to use it to calculate the performance of C code run on Nios ?
Thanks, Khai.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page