summaryrefslogtreecommitdiff
path: root/src/debug.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/debug.c')
-rw-r--r--src/debug.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/debug.c b/src/debug.c
index 2f62bedb0..6cfa61b91 100644
--- a/src/debug.c
+++ b/src/debug.c
@@ -329,8 +329,11 @@ void debugCommand(redisClient *c) {
} else if (!strcasecmp(c->argv[1]->ptr,"sleep") && c->argc == 3) {
double dtime = strtod(c->argv[2]->ptr,NULL);
long long utime = dtime*1000000;
+ struct timespec tv;
- usleep(utime);
+ tv.tv_sec = utime / 1000000;
+ tv.tv_nsec = (utime % 1000000) * 1000;
+ nanosleep(&tv, NULL);
addReply(c,shared.ok);
} else if (!strcasecmp(c->argv[1]->ptr,"set-active-expire") &&
c->argc == 3)