Skip to content

Latest commit

 

History

History
42 lines (23 loc) · 486 Bytes

File metadata and controls

42 lines (23 loc) · 486 Bytes

TTL


官方参考

TTL官方文档参考

命令语法

TTL key

作用

获取指定键的剩余过期时间, 单位 秒

复杂性

  • 时间复杂度

    • O(1)

参数

  • key

    需要获取剩余过期时间的键

返回结果

  • Integer reply

    键的剩余过期时间, 单位 秒

    • -2, 指定的键不存在时返回
    • -1, 指定的键存在, 但尚未设置过期时间时返回

示例

TTL key