Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | 1x 1x 1x 4x 4x 4x | import { IRequest } from "../../../server/request";
import { RedisToken } from "../../protocol/redis-token";
import { IRespCommand } from "../resp-command";
/**
* Available since v2.6.0
* The TIME command returns the current server time as a two items lists:
* a Unix timestamp and the amount of microseconds already elapsed in the
* current second. Basically the interface is very similar to the one of
* the gettimeofday system call.
*
* RETURNS: A multi bulk reply containing two elements:
* unix time in seconds.
* microseconds.
*/
export class TimeCommand extends IRespCommand {
public maxParams = 0
public minParams = 0
public name = "time"
public execSync(request: IRequest): RedisToken {
const currentTime: number[] = process.hrtime();
return RedisToken.array([
RedisToken.string(String(currentTime[0])),
RedisToken.string(String(currentTime[1]))
]);
}
}
|