diff options
| author | _ov4 <ov4@ov4.org> | 2026-10-23 12:41:14 +0000 |
|---|---|---|
| committer | _ov4 <ov4@ov4.org> | 2026-10-23 12:41:14 +0000 |
| commit | 9cdeda34930cba606725ce1497b72e006e1b1c54 (patch) | |
| tree | ddfb3b7a50966655ac935b15b62c598e7a8892ef /malloclab-handout/ftimer.h | |
| parent | 3526782dad25bc7caaf5bf49c0010c5e917b11f1 (diff) | |
init malloc lab
Diffstat (limited to 'malloclab-handout/ftimer.h')
| -rw-r--r-- | malloclab-handout/ftimer.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/malloclab-handout/ftimer.h b/malloclab-handout/ftimer.h new file mode 100644 index 0000000..3400603 --- /dev/null +++ b/malloclab-handout/ftimer.h @@ -0,0 +1,14 @@ +/* + * Function timers + */ +typedef void (*ftimer_test_funct)(void *); + +/* Estimate the running time of f(argp) using the Unix interval timer. + Return the average of n runs */ +double ftimer_itimer(ftimer_test_funct f, void *argp, int n); + + +/* Estimate the running time of f(argp) using gettimeofday + Return the average of n runs */ +double ftimer_gettod(ftimer_test_funct f, void *argp, int n); + |
