From 6686219f4029adf0033cefc9772773f06b44c497 Mon Sep 17 00:00:00 2001 From: hallski Date: Mon, 11 Sep 2006 19:19:30 +0000 Subject: [PATCH] use time --- loudmouth/lm-utils.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/loudmouth/lm-utils.c b/loudmouth/lm-utils.c index d80e1ed..370f6a3 100644 --- a/loudmouth/lm-utils.c +++ b/loudmouth/lm-utils.c @@ -70,12 +70,14 @@ _lm_utils_free_callback (LmCallback *cb) gchar * _lm_utils_generate_id (void) { - static guint last_id = 0; - gint random; - - random = g_random_int (); - - return g_strdup_printf ("%o%o", last_id++ ^ random, random); + static guint last_id = 0; + GTimeVal tv; + glong val; + + g_get_current_time (&tv); + val = (tv.tv_sec & tv.tv_usec) + last_id++; + + return g_strdup_printf ("%ld%ld", val, tv.tv_usec); } gchar * -- 2.34.1