]> git.scottworley.com Git - batteryviewer/blobdiff - batteryviewer.c
Grab the current time
[batteryviewer] / batteryviewer.c
index 5a516218e74ee01eb4dc0697bf12087ba44cfc24..19666f4e11db18aada3dcc2c15c7d426d6a12d8a 100644 (file)
@@ -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;
 }