You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kvrocks.apache.org by "infdahai (via GitHub)" <gi...@apache.org> on 2023/05/22 17:36:39 UTC

[GitHub] [incubator-kvrocks] infdahai commented on issue #1466: consider to replace system_clock with steady_clock

infdahai commented on issue #1466:
URL: https://github.com/apache/incubator-kvrocks/issues/1466#issuecomment-1557631895

   The more specific dicussion about the clock is placed [here in redis](https://github.com/redis/redis/pull/7644#issue-676476847).
   
   >We need to call ustime() because there is a cached timestamp which matches the wall-clock. This is set at the beginning of every command and is used to support various functions which need this recent wall-clock time.
   We also need to time the execution of the current command by measuring time before/after invoking the command. Measuring duration is something that we'd normally perform using the monotonic clock (not wall-clock).
   The logic is something like this:
   ```
   set cached_ustime = ustime()   // wall clock
   
   set command_start = getMonotonic()
   execute command
   set command_duration = getMonotonic() - command_start
   ```
   
   from https://github.com/redis/redis/pull/10502#issuecomment-1091972167
   
   So we don't need this issue currently in other word.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org