src/lib/apacheLog.c 1.4

1.4 2009/08/28 00:56:01 kent
Making it accept times in seconds or microseconds.
Index: src/lib/apacheLog.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/lib/apacheLog.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -b -B -U 4 -r1.3 -r1.4
--- src/lib/apacheLog.c	27 Aug 2009 20:52:01 -0000	1.3
+++ src/lib/apacheLog.c	28 Aug 2009 00:56:01 -0000	1.4
@@ -163,17 +163,21 @@
 
 /* Parse out elapsed time if it's there. */
 ll->runTime = -1;		/* Marker for unset. */
 char *runTime = nextWord(&e);
-char *seconds = nextWord(&e);
-if (seconds != NULL && sameString(seconds, "seconds"))
+char *label = nextWord(&e);
+if (label != NULL)
     {
     if (!isdigit(runTime[0]))
         {
 	badFormat(&ll, line, fileName, lineIx, "non-numerical seconds");
 	return NULL;
 	}
-    ll->runTime = atoi(runTime);
+    int x = atoi(runTime);
+    if (sameString(label, "seconds"))
+        ll->runTime = x*1000;
+    else if (sameString(label, "microseconds"))
+        ll->runTime = x/1000;
     }
 
 return ll;
 }