From 9cdeda34930cba606725ce1497b72e006e1b1c54 Mon Sep 17 00:00:00 2001 From: _ov4 Date: Fri, 23 Oct 2026 12:41:14 +0000 Subject: init malloc lab --- malloclab-handout/ftimer.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 malloclab-handout/ftimer.h (limited to 'malloclab-handout/ftimer.h') 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); + -- cgit v1.3.1-4-g156e