Skip to main content

Description

Returns PONG if no argument is provided, otherwise returns a copy of the argument as a bulk string. This command is useful for testing if a connection is still alive, or measuring latency.

Method Signature

Parameters

message
string
Optional message to echo back. If not provided, returns "PONG".

Return Value

result
string | 'PONG'
  • "PONG" if no message is provided
  • The provided message if one was given

Examples

Basic ping

Ping with message

Test connection

Measure latency

Health check

See Also

  • echo - Echo a message
  • time - Get server time