             return (1.0 / Double(NSEC_PER_SEC)) * Double(inNanoseconds)
         case .never:
             return Double.greatestFiniteMagnitude
+        @unknown default:
+            fatalError()
         }
 	}
 
-    public var inNanoseconds: Int {
+    var inNanoseconds: Int {
 		switch self {
 		case .seconds(let t): return Int(NSEC_PER_SEC) * t
 		case .milliseconds(let t): return Int(NSEC_PER_MSEC) * t
 		case .microseconds(let t): return Int(NSEC_PER_USEC) * t
 		case .nanoseconds(let t): return t
         case .never: return Int.max
-		}
+        @unknown default:
+            fatalError()
+        }
 	}
 }
 


public extension DispatchSourceTimer {
	// An overload of scheduleOneshot that updates the handler function with a new user-supplied parameter when it changes the expiry deadline
	public func scheduleOneshot<T>(parameter: T, interval: DispatchTimeInterval, since time: DispatchTime = DispatchTime.now(),leeway: DispatchTimeInterval = .nanoseconds(0), handler: @escaping (T) -> Void) {
		suspend()
		setEventHandler { handler(parameter) }
        schedule(deadline: time + interval, leeway: leeway)


public extension DispatchTimeInterval {
    
    static func fromSeconds(_ seconds: Double) -> DispatchTimeInterval {
		return .nanoseconds(Int(seconds * Double(NSEC_PER_SEC)))
	}

    var inSeconds: Double {
		switch self {
		case .seconds(let t):
            return Double(t)
