summaryrefslogtreecommitdiff
path: root/fw/fe310/eos/timer.c
diff options
context:
space:
mode:
Diffstat (limited to 'fw/fe310/eos/timer.c')
-rw-r--r--fw/fe310/eos/timer.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fw/fe310/eos/timer.c b/fw/fe310/eos/timer.c
index e07b9a6..d8cf107 100644
--- a/fw/fe310/eos/timer.c
+++ b/fw/fe310/eos/timer.c
@@ -129,3 +129,7 @@ uint64_t eos_time_get_tick(void) {
volatile uint64_t *mtime = (uint64_t *) (CLINT_CTRL_ADDR + CLINT_MTIME);
return *mtime;
}
+
+uint32_t eos_time_since(uint32_t start) {
+ return (eos_time_get_tick() - start) * 1000 / EOS_TIMER_RTC_FREQ;
+ }