1 /* Copyright (c) 2021. The SimGrid Team.
2 * All rights reserved. */
4 /* This program is free software; you can redistribute it and/or modify it
5 * under the terms of the license (GNU LGPL) which comes with this package. */
7 #include "simgrid/kernel/Timer.hpp"
13 Timer* Timer::set(double date, xbt::Task<void()>&& callback)
15 auto* timer = new Timer(date, std::move(callback));
16 timer->handle_ = kernel_timers().emplace(std::make_pair(date, timer));
20 /** @brief cancels a timer that was added earlier */
23 kernel_timers().erase(handle_);
29 } // namespace simgrid