8000 Getting Millisecond Extension by LabbiqX · Pull Request #11 · PaulStoffregen/Time · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Getting Millisecond Extension #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Time.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,11 @@ time_t now() {
return (time_t)sysTime;
}

time_t nowMs()
{
return (millis() - prevMillis) % 1000;
}

void setTime(time_t t) {
#ifdef TIME_DRIFT_INFO
if(sysUnsyncedTime == 0)
Expand Down
1 change: 1 addition & 0 deletions Time.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ int year(); // the full four digit year: (2009, 2010 etc)
int year(time_t t); // the year for the given time

time_t now(); // return the current time as seconds since Jan 1 1970
time_t nowMs();
void setTime(time_t t);
void setTime(int hr,int min,int sec,int day, int month, int yr);
void adjustTime(long adjustment);
Expand Down
0