Minor changes
authorSebastian Hack <hack@ipd.info.uni-karlsruhe.de>
Fri, 17 Aug 2007 11:55:39 +0000 (11:55 +0000)
committerSebastian Hack <hack@ipd.info.uni-karlsruhe.de>
Fri, 17 Aug 2007 11:55:39 +0000 (11:55 +0000)
[r15563]

ir/stat/statev.c
ir/stat/statev.h

index 3106316..27edb5a 100644 (file)
@@ -56,7 +56,7 @@ static lc_timer_t *timer = NULL;
 
 int stat_ev_enabled = 0;
 
-#define get_time() lc_timer_elapsed_msec(timer)
+#define get_time() lc_timer_elapsed_usec(timer)
 
 void stat_ev_ctx_push(const char *key, const char *value)
 {
@@ -131,3 +131,11 @@ void stat_ev_end(void)
        if (file_ev)
                fclose(file_ev);
 }
+
+void stat_ev_flush(void)
+{
+       unsigned long start = get_time();
+       if (file_ev)
+               fflush(file_ev);
+       time_in_ev += get_time() - start;
+}
index d79c59c..cc498ab 100644 (file)
@@ -43,6 +43,7 @@
 #define stat_ev_ctx_pop()
 #define stat_ev_begin(prefix)
 #define stat_ev_end()
+#define stat_ev_flush()
 
 #else
 
@@ -64,6 +65,7 @@ void stat_ev_ctx_pop(void);
 void stat_ev_emit(const char *name, double val);
 void stat_ev_begin(const char *prefix);
 void stat_ev_end(void);
+void stat_ev_flush(void);
 
 #endif