     }
     
     return cancelableBlock
-}
-
-func dispatchCancelableBlockAfterDelay(delay: Double, block: dispatch_block_t) -> CancelableDispatchBlock? {
-    
-    return dispatchCancelableBlockAtDate(NSDate(timeIntervalSinceNow: delay), block)
 }
 
 func cancelBlock(block: CancelableDispatchBlock?) {

import Foundation

typealias CancelableDispatchBlock = (cancel: Bool) -> Void

func timespecFromInterval(interval: NSTimeInterval) -> timespec {
    
    let nowWholeSecsFloor = floor(interval)
    let nowNanosOnly = interval - nowWholeSecsFloor
    let nowNanosFloor = floor(nowNanosOnly * Double(NSEC_PER_SEC))
    
    return timespec(tv_sec: Int(nowWholeSecsFloor), tv_nsec: Int(nowNanosFloor))
}

func dispatchCancelableBlockAtDate(date: NSDate, block: dispatch_block_t) -> CancelableDispatchBlock? {
    

    
    cancelableBlock = delayBlock
    
    let interval = Int64(date.timeIntervalSinceNow)
    let delay = interval * Int64(NSEC_PER_SEC)

