From cd2f985a5e565b0c1ddda072a8badce6c8e41f26 Mon Sep 17 00:00:00 2001 From: antirez Date: Sat, 12 May 2012 09:40:38 +0200 Subject: [PATCH] Add an implementation of mstime() to 2.4. Commit 9419eb0 back ported a better expired keys collection algorithm that is more incremental but for it to compile and work we need an implementation of the mstime() function that was missing in 2.4. --- src/util.c | 5 +++++ src/util.h | 1 + 2 files changed, 6 insertions(+) diff --git a/src/util.c b/src/util.c index 24af9fed..8691fd2f 100644 --- a/src/util.c +++ b/src/util.c @@ -339,6 +339,11 @@ long long ustime(void) { return ust; } +/* Return the UNIX time in milliseconds */ +long long mstime(void) { + return ustime()/1000; +} + #ifdef UTIL_TEST_MAIN #include diff --git a/src/util.h b/src/util.h index 339246e9..85e4ddc6 100644 --- a/src/util.h +++ b/src/util.h @@ -9,5 +9,6 @@ int string2ll(char *s, size_t slen, long long *value); int string2l(char *s, size_t slen, long *value); int d2string(char *buf, size_t len, double value); long long ustime(void); +long long mstime(void); #endif