 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 = date.timeIntervalSince1970
//    var time = timespecFromInterval(interval)
//    
//    dispatch_after(dispatch_walltime(&time, 0), dispatch_get_main_queue()) {

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


    }
    
    return cancelableBlock
}

func cancelBlock(block: CancelableDispatchBlock?) {
