From: erickson Date: Mon, 15 Aug 2005 13:42:42 +0000 (+0000) Subject: added microseconds to get_timestamp_millis() X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=4475913a1380f3b9b1cce06fffe14cc35d4c837a;p=opensrf%2Fbjwebb.git added microseconds to get_timestamp_millis() git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@478 9efc2488-bf62-4759-914b-345cdb29e865 --- 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;