 //===-----------------------------------------------------------------------===//
 
 import CUV
+import Boilerplate
 
 public typealias uv_timer_p = UnsafeMutablePointer<uv_timer_t>
 

    }
    
    //uv_timer_start
    public func start(timeout:UInt64, repeatTimeout:UInt64? = nil) throws {
        try doWithHandle { handle in
            let repeatTimeout:UInt64 = repeatTimeout ?? 0
            try Error.handle {
                uv_timer_start(handle, timer_cb, timeout, repeatTimeout)
            }
        }
    }

        }
    }
    
    public var repeatTimeout:Timeout {
        //uv_timer_get_repeat
        get {
            return handle.isNil() ? .Immediate : Timeout(uvTimeout: uv_timer_get_repeat(handle))
        }
        //uv_timer_set_repeat
        set {
            if !handle.isNil() {
                uv_timer_set_repeat(handle, newValue.uvTimeout)
            }
        }
    }
