use time
authorhallski <hallski>
Mon, 11 Sep 2006 19:19:30 +0000
changeset 177 3ef4992a4898
parent 176 5cddc8cc2f78
child 178 260d6853b457
use time
loudmouth/lm-utils.c
--- a/loudmouth/lm-utils.c	Mon Sep 11 19:14:23 2006 +0000
+++ b/loudmouth/lm-utils.c	Mon Sep 11 19:19:30 2006 +0000
@@ -70,12 +70,14 @@
 gchar *
 _lm_utils_generate_id (void)
 {
-	static guint last_id = 0;
-	gint         random;
+	static guint  last_id = 0;
+	GTimeVal      tv;
+	glong         val;
 
-	random = g_random_int ();
-	
-	return g_strdup_printf ("%o%o", last_id++ ^ random, random);
+	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 *