From 51a39b464e13ca489205a5d0a24427970fa9fc2c Mon Sep 17 00:00:00 2001 From: Scott Worley Date: Thu, 23 Feb 2023 19:41:13 -0800 Subject: [PATCH] Grab the current time --- batteryviewer.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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; } -- 2.44.1