mcabber/src/utils.c
changeset 419 2f9852610cf4
parent 393 f8f3c7493457
child 428 4470868f90e5
--- a/mcabber/src/utils.c	Thu Sep 01 23:48:46 2005 +0200
+++ b/mcabber/src/utils.c	Fri Sep 02 20:34:17 2005 +0200
@@ -223,3 +223,12 @@
 
   return retval;
 }
+
+// Should only be used for delays < 1s
+inline void safe_usleep(unsigned int usec)
+{
+  struct timespec req;
+  req.tv_sec = 0;
+  req.tv_nsec = (long)usec * 1000L;
+  nanosleep(&req, NULL);
+}