Files
core_misc/tjp/core/time-obsolete/Scheduler.cpp
Timothy Prepscius fa54be052a flatten 20260225
2026-02-25 12:39:24 -05:00

35 lines
507 B
C++

// TJP COPYRIGHT HEADER
//
// Timer.h
// algorithm
//
// Created by Timothy Prepscius on 1/19/18.
// Copyright © 2018 Timothy Prepscius. All rights reserved.
//
#include "Scheduler.hpp"
namespace timprepscius::core::time {
Scheduler::~Scheduler ()
{
}
Future<void> Scheduler::after(Time period)
{
Promise<void> v;
auto event = schedule(
period,
false,
[v]() {
auto r = v;
r.set_value();
}
);
return v.get_future().then([event](auto &&f) { return f.get(); });
}
} // namespace