Skip to content

Commit

Permalink
Forgot one file
Browse files Browse the repository at this point in the history
  • Loading branch information
mattam82 committed Jun 11, 2024
1 parent 5fab564 commit da5aa24
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions benchmarks/lazy_factorial_main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#include <stdio.h>
#include <stdlib.h>
#include "gc_stack.h"
#include <time.h>

extern value body(struct thread_info *);

int main(int argc, char *argv[]) {
value val;
struct thread_info* tinfo;
clock_t start, end;
double msec, sec;

// Specify number of runs
int n = 1;
if (argc > 1) n = atoi(argv[1]);

start = clock();
// Run Coq program
for (int i = 0; i < n; i ++) {
tinfo = make_tinfo();
body(tinfo);
}
end = clock();

/* TODO write string printers */
/* print_Coq_Init_Datatypes_list(val, print_Coq_Init_Datatypes_bool); */
/* printf("\n"); */

sec = (double)(end - start)/CLOCKS_PER_SEC;
msec = 1000*sec;
printf("Time taken %f seconds %f milliseconds\n", sec, msec);

return 0;
}

0 comments on commit da5aa24

Please sign in to comment.