X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/0f85c75558b648a231f53f4dba18cc6788858b10..e79c652187a77f7383b81afb91a4adc8d38986ef:/include/simgrid/s4u/actor.hpp diff --git a/include/simgrid/s4u/actor.hpp b/include/simgrid/s4u/actor.hpp index 8e1b70395a..5039f84983 100644 --- a/include/simgrid/s4u/actor.hpp +++ b/include/simgrid/s4u/actor.hpp @@ -7,6 +7,7 @@ #define SIMGRID_S4U_ACTOR_HPP #include +#include #include #include #include @@ -20,6 +21,7 @@ #include #include +#include #include #include @@ -258,6 +260,13 @@ namespace this_actor { /** Block the actor sleeping for that amount of seconds (may throws hostFailure) */ XBT_PUBLIC(void) sleep(double duration); + template + inline void sleep(std::chrono::duration duration) + { + auto seconds = std::chrono::duration_cast(duration); + sleep(seconds.count()); + } + /** Block the actor, computing the given amount of flops */ XBT_PUBLIC(e_smx_state_t) execute(double flop);