             txtMsg.backgroundColor = "#ff3300"
             self.actor.notify(txtMsg)
             
-            sleep(UInt32(self.seconds))
-            
-            self.actor.sendMessage(OperationComplete("pause", msg: ""))
+            self.after(self.seconds) {
+                self.actor.sendMessage(OperationComplete("pause", msg: ""))
+            }
+        }
+    }
+    
+    private func after(seconds:Double, _ complete:()->Void) {
+        dispatch_after(dispatch_time(DISPATCH_TIME_NOW, Int64(seconds * Double(NSEC_PER_SEC))),
+            dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, 0)) {
+                
+            complete()
         }
     }
 }

}

public class PauseMessage : Message {
    var seconds:Int = 0
    
    public init(_ seconds:Int) {
        self.seconds = seconds
        super.init("pause")
    }

                
            case "pause":
                var lengthStr = cmd.bodyText().stringByTrimmingCharactersInSet(NSCharacterSet.whitespaceCharacterSet())
                msg = PauseMessage(lengthStr.toDouble()!)
                
            case "var", "setvariable":
                
