From 4475913a1380f3b9b1cce06fffe14cc35d4c837a Mon Sep 17 00:00:00 2001 From: erickson Date: Mon, 15 Aug 2005 13:42:42 +0000 Subject: [PATCH] added microseconds to get_timestamp_millis() git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@478 9efc2488-bf62-4759-914b-345cdb29e865 --- src/utils/utils.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/utils/utils.c b/src/utils/utils.c index 12cb0d0..103a106 100644 --- a/src/utils/utils.c +++ b/src/utils/utils.c @@ -37,9 +37,10 @@ inline void* safe_malloc( int size ) { /* utility method for profiling */ double get_timestamp_millis() { struct timeb t; + struct timeval tv; + gettimeofday(&tv, NULL); ftime(&t); - double time = ( - (int)t.time + ( ((double)t.millitm) / 1000 ) ); + double time = (int)t.time + ( ((double)t.millitm) / 1000 ) + ( ((double)tv.tv_usec / 1000000) ); return time; } @@ -323,7 +324,7 @@ int daemonize() { int stringisnum(char* s) { char* w = (char*) malloc(strlen(s) * sizeof(char*)); bzero(w, strlen(s)); - long blah = strtol(s, &w, 10); + strtol(s, &w, 10); if(strlen(w) > 0) return 0; return 1; -- 2.11.0