]> git.saurik.com Git - redis.git/commitdiff
DEUBG SLEEP implemented
authorantirez <antirez@gmail.com>
Thu, 30 Jun 2011 11:31:44 +0000 (13:31 +0200)
committerantirez <antirez@gmail.com>
Thu, 30 Jun 2011 11:31:44 +0000 (13:31 +0200)
src/debug.c

index 511512ddec8f120eaa571f9258b0923443cc8a07..966e0eb403901770c46403665259881bf5b3b62a 100644 (file)
@@ -281,6 +281,12 @@ void debugCommand(redisClient *c) {
             d = sdscatprintf(d, "%02x",digest[j]);
         addReplyStatus(c,d);
         sdsfree(d);
+    } else if (!strcasecmp(c->argv[1]->ptr,"sleep") && c->argc == 3) {
+        double dtime = strtod(c->argv[2]->ptr,NULL);
+        long long utime = dtime*1000000;
+
+        usleep(utime);
+        addReply(c,shared.ok);
     } else {
         addReplyError(c,
             "Syntax error, try DEBUG [SEGFAULT|OBJECT <key>|SWAPIN <key>|SWAPOUT <key>|RELOAD]");