MCPcopy Create free account
hub / github.com/distributedio/titan / Time

Function Time

command/server.go:351–358  ·  view source on GitHub ↗

Time returns the server time

(ctx *Context)

Source from the content-addressed store, hash-verified

349
350// Time returns the server time
351func Time(ctx *Context) {
352 now := time.Now().UnixNano() / int64(time.Microsecond)
353 sec := now / 1000000
354 msec := now % sec
355 resp.ReplyArray(ctx.Out, 2)
356 resp.ReplyBulkString(ctx.Out, strconv.Itoa(int(sec)))
357 resp.ReplyBulkString(ctx.Out, strconv.Itoa(int(msec)))
358}
359
360// Info returns information and statistics about the server in a format that is simple to parse by computers and easy to read by humans
361func Info(ctx *Context) {

Callers

nothing calls this directly

Calls 2

ReplyArrayFunction · 0.92
ReplyBulkStringFunction · 0.92

Tested by

no test coverage detected