PSETEX

Syntax

  1. PSETEX key milliseconds value

Time complexity: O(1)

PSETEX works exactly like SETEX with the sole difference that the expire time is specified in milliseconds instead of seconds.

Examples

  1. dragonfly> PSETEX mykey 1000 "Hello"
  2. "OK"
  3. dragonfly> PTTL mykey
  4. (integer) 1000
  5. dragonfly> GET mykey
  6. "Hello"