Edited sieve to work with wally. It was using the time of day to compute runspeed; however this functionality does not yet work in the wally software stack.

This commit is contained in:
Ross Thompson 2021-03-24 09:22:21 -05:00
parent 1c6e37120e
commit efa8ad4e17

View File

@ -61,26 +61,26 @@ int main () {
int ans;
struct timeval before , after;
gettimeofday(&before , NULL);
//struct timeval before , after;
//gettimeofday(&before , NULL);
ans = sieve ();
gettimeofday(&after , NULL);
//gettimeofday(&after , NULL);
if (ans != 1899)
printf ("Sieve result wrong, ans = %d, expected 1899", ans);
printf("Total time elapsed : %.0lf us\n" , time_diff(before , after) );
//printf("Total time elapsed : %.0lf us\n" , time_diff(before , after) );
printf("Round 2\n");
gettimeofday(&before , NULL);
//gettimeofday(&before , NULL);
ans = sieve ();
gettimeofday(&after , NULL);
//gettimeofday(&after , NULL);
if (ans != 1899)
printf ("Sieve result wrong, ans = %d, expected 1899", ans);
printf("Total time elapsed : %.0lf us\n" , time_diff(before , after) );
//printf("Total time elapsed : %.0lf us\n" , time_diff(before , after) );
return 0;