Added boot_time.

* uptime.c: (glibtop_get_uptime_p): Added boot_time.
This commit is contained in:
Benoît Dejean
2004-05-25 14:42:51 +00:00
parent 4e4a2bcbed
commit 1faa40ce18
4 changed files with 12 additions and 0 deletions

View File

@@ -1,3 +1,7 @@
2004-05-25 Benoît Dejean <tazforever@dlfp.org>
* uptime.c: (glibtop_get_uptime_p): Added boot_time.
2004-03-09 Bastien Nocera <hadess@hadess.net>
* procargs.c: (glibtop_get_proc_args_s): fix g_malloc usage on non-Linux

View File

@@ -29,6 +29,8 @@
#include <glibtop_suid.h>
#include <time.h>
static const unsigned long _glibtop_sysdeps_uptime =
(1L << GLIBTOP_UPTIME_UPTIME) + (1L << GLIBTOP_UPTIME_IDLETIME);
@@ -68,6 +70,7 @@ glibtop_get_uptime_p (glibtop *server, glibtop_uptime *buf)
buf->uptime = (double) cpu.total / (double) cpu.frequency;
buf->idletime = (double) cpu.idle / (double) cpu.frequency;
buf->boot_time = (guint64) time(NULL) - (guint64) buf->uptime;
buf->flags = _glibtop_sysdeps_uptime;
}

View File

@@ -1,3 +1,7 @@
2004-05-25 Benoît Dejean <tazforever@dlfp.org>
* uptime.c: (glibtop_get_uptime_p): Added boot_time.
2004-03-09 Bastien Nocera <hadess@hadess.net>
* open.c: (glibtop_open_p):

View File

@@ -56,6 +56,7 @@ glibtop_get_uptime_p (glibtop *server, glibtop_uptime *buf)
buf->uptime = (double) cpu.total / (double) cpu.frequency;
buf->idletime = (double) cpu.idle / (double) cpu.frequency;
buf->boot_time = (guint64) time(NULL) - (guint64) buf->uptime;
buf->flags = _glibtop_sysdeps_uptime;
}