+int sthread_gettimeofday(struct timeval* tv)
+{
+ if (tv) {
+ double now = simgrid::s4u::Engine::get_clock();
+ double secs = trunc(now);
+ double usecs = (now - secs) * 1e6;
+ tv->tv_sec = static_cast<time_t>(secs);
+ tv->tv_usec = static_cast<decltype(tv->tv_usec)>(usecs); // suseconds_t
+ }
+ return 0;
+}
+
+void sthread_sleep(double seconds)
+{
+ simgrid::s4u::this_actor::sleep_for(seconds);
+}
+