aboutsummaryrefslogtreecommitdiffstats
path: root/ClockMeter.c
diff options
context:
space:
mode:
authorDaniel Lange <DLange@git.local>2021-09-21 08:35:19 +0200
committerDaniel Lange <DLange@git.local>2021-09-21 08:35:19 +0200
commit69f439eff387a6ecb52734e400b297a3c85f2285 (patch)
tree2a988b7868b749654796183ba70b4272965da1bf /ClockMeter.c
parentc55320e9e2a8916e911bcd39ab37b79e3a7d03b2 (diff)
downloaddebian_htop-69f439eff387a6ecb52734e400b297a3c85f2285.tar.gz
debian_htop-69f439eff387a6ecb52734e400b297a3c85f2285.tar.bz2
debian_htop-69f439eff387a6ecb52734e400b297a3c85f2285.zip
New upstream version 3.1.0upstream/3.1.0
Diffstat (limited to 'ClockMeter.c')
-rw-r--r--ClockMeter.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/ClockMeter.c b/ClockMeter.c
index 023ca42..79bdecd 100644
--- a/ClockMeter.c
+++ b/ClockMeter.c
@@ -10,21 +10,24 @@ in the source distribution for its full text.
#include "ClockMeter.h"
#include <time.h>
+#include <sys/time.h>
#include "CRT.h"
#include "Object.h"
+#include "ProcessList.h"
static const int ClockMeter_attributes[] = {
CLOCK
};
-static void ClockMeter_updateValues(Meter* this, char* buffer, size_t size) {
- time_t t = time(NULL);
+static void ClockMeter_updateValues(Meter* this) {
+ const ProcessList* pl = this->pl;
+
struct tm result;
- struct tm* lt = localtime_r(&t, &result);
+ const struct tm* lt = localtime_r(&pl->realtime.tv_sec, &result);
this->values[0] = lt->tm_hour * 60 + lt->tm_min;
- strftime(buffer, size, "%H:%M:%S", lt);
+ strftime(this->txtBuffer, sizeof(this->txtBuffer), "%H:%M:%S", lt);
}
const MeterClass ClockMeter_class = {

© 2014-2024 Faster IT GmbH | imprint | privacy policy