From: Scott Worley Date: Fri, 24 Feb 2023 03:41:13 +0000 (-0800) Subject: Grab the current time X-Git-Url: http://git.scottworley.com/batteryviewer/commitdiff_plain/51a39b464e13ca489205a5d0a24427970fa9fc2c?ds=sidebyside Grab the current time --- diff --git a/batteryviewer.c b/batteryviewer.c index 5a51621..19666f4 100644 --- a/batteryviewer.c +++ b/batteryviewer.c @@ -60,8 +60,9 @@ static float fatof(const char *filename) { } static gboolean collect_data(struct State *state) { - fprintf(stderr, "Voltage: %f, current: %f\n", fatof(state->voltage_filename), - fatof(state->current_filename)); + float now = g_get_monotonic_time() / 1e6; + fprintf(stderr, "%f: Voltage: %f, current: %f\n", now, + fatof(state->voltage_filename), fatof(state->current_filename)); return TRUE; }