diff --git a/README.md b/README.md
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-# netcode-io
+# netcode-io [![Build Status](https://travis-ci.org/Mokosha/netcode-io.svg?branch=master)](https://travis-ci.org/Mokosha/netcode-io)
 Haskell bindings to the
 [netcode.io](https://github.com/networkprotocol/netcode.io) library
 
@@ -50,4 +50,4 @@
 
 IANAL, but these bindings use
 [the same license](https://github.com/networkprotocol/netcode.io/blob/master/LICENCE)
-that the original library uses, so you must comply with both.
+that the original library uses, so you must comply with both.
diff --git a/netcode-io.cabal b/netcode-io.cabal
--- a/netcode-io.cabal
+++ b/netcode-io.cabal
@@ -1,6 +1,6 @@
 cabal-version:       >= 1.10
 name:                netcode-io
-version:             0.0.1
+version:             0.0.2
 synopsis:            Bindings to the low-level netcode.io library.
 description:         Bindings to the low-level netcode.io library, which come
                      in two flavors: c-level bindings and a high-level
@@ -40,6 +40,9 @@
     -- possible. That way we don't need to go around copying .dll files.
     ld-options:        -static
     extra-libraries:   ws2_32
+
+  if os(linux)
+    cc-options:        -D_POSIX_C_SOURCE=199309L
 
   exposed-modules:     Bindings.Netcode.IO
                      , Netcode.IO
diff --git a/netcode.io/netcode.c b/netcode.io/netcode.c
--- a/netcode.io/netcode.c
+++ b/netcode.io/netcode.c
@@ -5179,7 +5179,10 @@
 
 void netcode_sleep( double time )
 {
-    usleep( (int) ( time * 1000000 ) );
+    struct timespec ts;
+    ts.tv_sec = (time_t) time;
+    ts.tv_nsec = (long) ((time - (double) ( ts.tv_sec )) * 1000000000.0);
+    nanosleep( &ts, NULL );
 }
 
 static uint64_t start = 0;
@@ -5205,7 +5208,10 @@
 
 void netcode_sleep( double time )
 {
-    usleep( (int) ( time * 1000000 ) );
+    struct timespec ts;
+    ts.tv_sec = (time_t) time;
+    ts.tv_nsec = (long) ((time - (double) ( ts.tv_sec )) * 1000000000.0);
+    nanosleep( &ts, NULL );
 }
 
 double netcode_time()
