diff --git a/Time.cpp b/Time.cpp index 4cb01e7..9a9c675 100644 --- a/Time.cpp +++ b/Time.cpp @@ -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) diff --git a/Time.h b/Time.h index 61519f7..f459866 100644 --- a/Time.h +++ b/Time.h @@ -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);