aboutsummaryrefslogtreecommitdiffstats
path: root/src/util.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2009-03-25 12:31:39 +0300
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2009-03-25 12:31:39 +0300
commit62aaf7da57503a257aecede98ba2ae2e1f2ee3e2 (patch)
treeff6d99673a8ebf08d27716beaf4ea689d4aa98f9 /src/util.c
parentf592edf20b6d91fb6c25d9d3b1021d2ab4c5fcb3 (diff)
downloadrspamd-62aaf7da57503a257aecede98ba2ae2e1f2ee3e2.tar.gz
rspamd-62aaf7da57503a257aecede98ba2ae2e1f2ee3e2.zip
* Log scan time and scan length of messages
* Remove 2 memory leaks
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/util.c b/src/util.c
index 1fdd2758a..ef9531bd3 100644
--- a/src/util.c
+++ b/src/util.c
@@ -787,6 +787,20 @@ resolve_stat_filename (memory_pool_t *pool, char *pattern, char *rcpt, char *fro
return new;
}
+long int
+calculate_check_time (struct timespec *begin)
+{
+ struct timespec ts;
+ long int res;
+
+ clock_gettime (CLOCK_REALTIME, &ts);
+
+ res = (ts.tv_sec - begin->tv_sec) * 1000 + /* Seconds */
+ (ts.tv_nsec - begin->tv_nsec) / 1000000; /* Nanoseconds */
+
+ return res;
+}
+
/*
* vi:ts=4
*/