Skip to content

Give access to _lastUpdate would let users deal with better accuracy requirements #23

Open
@ybizeul

Description

@ybizeul

I'm working on an application that is time sensitive, at least in a relative way.
I don't need exact microsecond precision of the returned time, but I need a more or less reliable way to determine at the millisecond where I'm standing compared to the epoch.

Simply giving access to _lastUpdate does the job I think, as I can now get a string representing a ms epoch that way :

unsigned long seconds = timeClient.getEpochTime();
unsigned long ms = (millis() - timeClient.getLastUpdate()) % 1000;
char ms_char[12];
sprintf(ms_char,"%lu%03lu",seconds,ms);

Now I don't know what the best design is for this library :

  • Propose a getMillisecondString()
  • Simply let use deal with a public getLastUpdate() like I did
  • Deal with 64bit to return a ms epoch as a number...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions