Skip to content

Commit

Permalink
cron_to_next now has optional from parameter.
Browse files Browse the repository at this point in the history
  • Loading branch information
Bosma committed Feb 21, 2018
1 parent 3894d0c commit 3c0a656
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Cron.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ namespace Bosma {
}

// http://stackoverflow.com/a/322058/1284550
Clock::time_point cron_to_next() const {
Clock::time_point cron_to_next(const Clock::time_point from = Clock::now()) const {
// get current time as a tm object
auto now = Clock::to_time_t(Clock::now());
auto now = Clock::to_time_t(from);
std::tm next(*std::localtime(&now));
// it will always at least run the next minute
next.tm_sec = 0;
Expand Down

0 comments on commit 3c0a656

Please sign in to comment.