Skip to content

Commit

Permalink
Update schedule.hpp
Browse files Browse the repository at this point in the history
  • Loading branch information
michalmaj authored Feb 6, 2024
1 parent 48bc161 commit e852d12
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions homework/schedule/schedule.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ void schedule(T func, std::chrono::seconds duration, Args... args);

template <typename T, typename... Args>
void schedule(T func, std::chrono::seconds duration, Args... args) {
auto start = std::chrono::steady_clock::now();
auto start = std::chrono::steady_clock::now();

while (std::chrono::steady_clock::now() - start < duration)
;
std::invoke(func, args...);
while (std::chrono::steady_clock::now() - start < duration)
;
std::invoke(func, args...);
}

0 comments on commit e852d12

Please sign in to comment.