[sysprof] clock: prefer clock monotonic
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [sysprof] clock: prefer clock monotonic
- Date: Wed, 16 May 2018 11:31:23 +0000 (UTC)
commit f8176b699b31f87d685bc575e715f68bae87a121
Author: Christian Hergert <chergert redhat com>
Date: Wed May 16 12:28:42 2018 +0100
clock: prefer clock monotonic
Various articles claim that CLOCK_MONOTONIC is actually faster than the
CLOCK_MONOTONIC_RAW, and that seems to be my experience.
lib/sp-clock.c | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/lib/sp-clock.c b/lib/sp-clock.c
index 1de3227..48cc9c3 100644
--- a/lib/sp-clock.c
+++ b/lib/sp-clock.c
@@ -24,18 +24,17 @@ void
sp_clock_init (void)
{
static const gint clock_ids[] = {
+ CLOCK_MONOTONIC,
CLOCK_MONOTONIC_RAW,
CLOCK_MONOTONIC_COARSE,
- CLOCK_MONOTONIC,
CLOCK_REALTIME_COARSE,
CLOCK_REALTIME,
};
- guint i;
if (sp_clock != -1)
return;
- for (i = 0; i < G_N_ELEMENTS (clock_ids); i++)
+ for (guint i = 0; i < G_N_ELEMENTS (clock_ids); i++)
{
struct timespec ts;
int clock_id = clock_ids [i];
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]