diff options
Diffstat (limited to 'keyboards/claw44/lib/timelogger.c')
| -rw-r--r-- | keyboards/claw44/lib/timelogger.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/keyboards/claw44/lib/timelogger.c b/keyboards/claw44/lib/timelogger.c new file mode 100644 index 000000000..ecd4ed3ea --- /dev/null +++ b/keyboards/claw44/lib/timelogger.c | |||
| @@ -0,0 +1,16 @@ | |||
| 1 | #include <stdio.h> | ||
| 2 | #include "claw44.h" | ||
| 3 | |||
| 4 | char timelog_str[24] = {}; | ||
| 5 | int last_time = 0; | ||
| 6 | int elapsed_time = 0; | ||
| 7 | |||
| 8 | void set_timelog(void) { | ||
| 9 | elapsed_time = timer_elapsed(last_time); | ||
| 10 | last_time = timer_read(); | ||
| 11 | snprintf(timelog_str, sizeof(timelog_str), "lt:%5d, et:%5d", last_time, elapsed_time); | ||
| 12 | } | ||
| 13 | |||
| 14 | const char *read_timelog(void) { | ||
| 15 | return timelog_str; | ||
| 16 | } | ||
