From d8c4129ae2f9d23bcb60e0ae4bb78a34990a0ad2 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/ILS/trunk@1656 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- OpenSRF/src/utils/utils.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/OpenSRF/src/utils/utils.c b/OpenSRF/src/utils/utils.c index 12cb0d005b..103a106ca0 100644 --- a/OpenSRF/src/utils/utils.c +++ b/OpenSRF/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.43.2