]> git.scottworley.com Git - batteryviewer/commitdiff
Grab the current time
authorScott Worley <scottworley@scottworley.com>
Fri, 24 Feb 2023 03:41:13 +0000 (19:41 -0800)
committerScott Worley <scottworley@scottworley.com>
Fri, 24 Feb 2023 03:41:13 +0000 (19:41 -0800)
batteryviewer.c

index 5a516218e74ee01eb4dc0697bf12087ba44cfc24..19666f4e11db18aada3dcc2c15c7d426d6a12d8a 100644 (file)
@@ -60,8 +60,9 @@ static float fatof(const char *filename) {
 }
 
 static gboolean collect_data(struct State *state) {
 }
 
 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;
 }
 
   return TRUE;
 }