aboutsummaryrefslogtreecommitdiff
path: root/malloclab-handout/clock.h
diff options
context:
space:
mode:
author_ov4 <ov4@ov4.org>2026-10-23 12:41:14 +0000
committer_ov4 <ov4@ov4.org>2026-10-23 12:41:14 +0000
commit9cdeda34930cba606725ce1497b72e006e1b1c54 (patch)
treeddfb3b7a50966655ac935b15b62c598e7a8892ef /malloclab-handout/clock.h
parent3526782dad25bc7caaf5bf49c0010c5e917b11f1 (diff)
init malloc lab
Diffstat (limited to 'malloclab-handout/clock.h')
-rw-r--r--malloclab-handout/clock.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/malloclab-handout/clock.h b/malloclab-handout/clock.h
new file mode 100644
index 0000000..54d26ac
--- /dev/null
+++ b/malloclab-handout/clock.h
@@ -0,0 +1,22 @@
+/* Routines for using cycle counter */
+
+/* Start the counter */
+void start_counter();
+
+/* Get # cycles since counter started */
+double get_counter();
+
+/* Measure overhead for counter */
+double ovhd();
+
+/* Determine clock rate of processor (using a default sleeptime) */
+double mhz(int verbose);
+
+/* Determine clock rate of processor, having more control over accuracy */
+double mhz_full(int verbose, int sleeptime);
+
+/** Special counters that compensate for timer interrupt overhead */
+
+void start_comp_counter();
+
+double get_comp_counter();