Skip to content

How do I know if getServerTime() succeeded? #1

@brianjmurrell

Description

@brianjmurrell

It's entirely possible that getServerTime() could fail in which case I'd want to keep calling it until it succeeds or some timeout is reached.

But there is no way for me to know if it was successful since it's private and I only get access to it indirectly through getUnixTime() which is skewed by millis().

So ultimately, I have no way of knowing if I can rely on what getUnixTime() is telling me other than to use some "less than some smallish-value" type heuristics.

I think the library either needs a flag to indicate that the time is accurate (i.e. there was a successful NTP transaction) or getUnixTime() should return 0 until the time is accurate the way getServerTime() does.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions