2
0
Jiri Kuthan 23 жил өмнө
parent
commit
fb9d2755ab
1 өөрчлөгдсөн 14 нэмэгдсэн , 0 устгасан
  1. 14 0
      ut.h

+ 14 - 0
ut.h

@@ -7,6 +7,12 @@
 #ifndef ut_h
 #define ut_h
 
+
+#include <sys/types.h>
+#include <sys/time.h>
+#include <unistd.h>
+
+
 #include "dprint.h"
 
 
@@ -227,4 +233,12 @@ inline static int string2hex(
 	return orig_len-len;
 }
 
+inline static void sleep_us( unsigned int nusecs )
+{
+	struct timeval tval;
+	tval.tv_sec=nusecs/100000;
+	tval.tv_usec=nusecs%1000000;
+	select(0, NULL, NULL, NULL, &tval );
+}
+
 #endif