Altera_Forum
Honored Contributor
15 years agosorting time issue
Hi,
I want to calculate the time taken to sort the files alphabetically. I am using timestamp driver. In the output gives me the sorted file names but the the time taken to sort it is always zero. I am using DE2 board. Following is my code
#include "sys/alt_timestamp.h"# include "alt_types.h"# include <stdio.h># include <string.h>
//Sort() definition
int main()
{
int i; /* loop variable */
alt_u32 time1;
alt_u32 time2;
alt_timestamp_start();
time1 = alt_timestamp();
//sort();
time2 = alt_timestamp();
printf("Time taken to print = %u ticks\n", (unsigned int)time2-time1);
printf("Number of ticks per second = %u\n",(unsigned int)alt_timestamp_freq());
}