Skip to content
This repository has been archived by the owner on Dec 1, 2022. It is now read-only.

Get current time with milliseconds precision. #523

Merged

Conversation

Shylock-Hg
Copy link
Contributor

@Shylock-Hg Shylock-Hg commented Apr 26, 2021

@Shylock-Hg Shylock-Hg added the ready-for-testing PR: ready for the CI test label Apr 26, 2021
@Shylock-Hg Shylock-Hg requested a review from a team April 26, 2021 08:51
Copy link
Contributor

@laura-ding laura-ding left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add some tests?

@@ -278,6 +271,17 @@ class TimeUtils {

static Timezone globalTimezone;

struct UnixTime {
int64_t seconds{0};
int64_t milliseconds{0};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here is microseconds

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Milliseconds in fact.


// <seconds, milliseconds>
static UnixTime unixTime() {
auto ms = WallClock::fastNowInMilliSec();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can use fastNowInMicroSec directly

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The cypher only provide the milliseconds precision

@Shylock-Hg Shylock-Hg requested review from laura-ding and a team April 28, 2021 01:59
@randomJoe211 randomJoe211 added the doc affected Solution: improvements or additions to documentation label Apr 28, 2021
@Shylock-Hg
Copy link
Contributor Author

Shylock-Hg commented Apr 29, 2021

Could you add some tests?

Can't know the current time number, so no better way to compare it.

Copy link
Contributor

@bright-starry-sky bright-starry-sky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@CLAassistant
Copy link

CLAassistant commented Jun 17, 2021

CLA assistant check
All committers have signed the CLA.

Aiee
Aiee previously approved these changes Jul 2, 2021
@Shylock-Hg Shylock-Hg dismissed stale reviews from Aiee and bright-starry-sky via 478bdf5 July 2, 2021 03:01
@Shylock-Hg Shylock-Hg added the bug Type: something is unexpected label Jul 2, 2021
@Shylock-Hg Shylock-Hg requested review from Aiee, bright-starry-sky and a team July 2, 2021 03:01
@yixinglu yixinglu merged commit 82524be into vesoft-inc:master Jul 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Type: something is unexpected doc affected Solution: improvements or additions to documentation ready-for-testing PR: ready for the CI test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Time() and datetime() did not return milliseconds
7 participants