Adds RM_Microseconds and RM_CachedMicroseconds#11016
Merged
oranagra merged 4 commits intoredis:unstablefrom Jul 27, 2022
Merged
Adds RM_Microseconds and RM_CachedMicroseconds#11016oranagra merged 4 commits intoredis:unstablefrom
oranagra merged 4 commits intoredis:unstablefrom
Conversation
RM_Time Return the wall-clock Unix time, in microseconds RM_CachedTime Returns a cached copy of th Unix time, in microseconds. It is updated in the server cron job and before executing a command. It is useful for complex call stacks, such as a command causing a key space notification, causing a module to execute a RedisModule_Call, causing another notification, etc. It makes sense that all this callbacks would use the same clock.
oranagra
approved these changes
Jul 20, 2022
Member
oranagra
left a comment
There was a problem hiding this comment.
API LTGM.
@redis/core-team please approve
yossigo
reviewed
Jul 20, 2022
guybe7
commented
Jul 20, 2022
enjoy-binbin
reviewed
Sep 4, 2022
|
|
||
| /* Return the current UNIX time in milliseconds. */ | ||
| long long RM_Milliseconds(void) { | ||
| mstime_t RM_Milliseconds(void) { |
Contributor
There was a problem hiding this comment.
I was looking at some calls to mstime() and saw this.
do we also need a RM_CachedMilliseconds that will return server.mstime?
Collaborator
Author
There was a problem hiding this comment.
One can use CachedMicroseconds and divide by 1000
enjoy-binbin
pushed a commit
to enjoy-binbin/redis
that referenced
this pull request
Jul 31, 2023
RM_Microseconds Return the wall-clock Unix time, in microseconds RM_CachedMicroseconds Returns a cached copy of the Unix time, in microseconds. It is updated in the server cron job and before executing a command. It is useful for complex call stacks, such as a command causing a key space notification, causing a module to execute a RedisModule_Call, causing another notification, etc. It makes sense that all these callbacks would use the same clock.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
RM_Microseconds
Return the wall-clock Unix time, in microseconds
RM_CachedMicroseconds
Returns a cached copy of the Unix time, in microseconds.
It is updated in the server cron job and before executing a command.
It is useful for complex call stacks, such as a command causing a
key space notification, causing a module to execute a RedisModule_Call,
causing another notification, etc.
It makes sense that all these callbacks would use the same clock.