qmk

QMK Firmware
git clone git://git.z3bra.org/qmk.git
Log | Files | Refs | Submodules | LICENSE

timelogger.c (354B)


      1 #include <stdio.h>
      2 #include "lily58.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 }