 
   public final func timeout(seconds s: Double, reason: String = DefaultTimeoutMessage) -> Deferred
   {
-    return timeout64(ns: Int64(max(s*1e9,0)), reason: reason)
+    if self.isDetermined { return self }
+    if s > 0
+    {
+      return Timeout(source: self, deadline: .now() + s, reason: reason)
+    }
+    return Mapped(source: self, result: Result.error(DeferredError.canceled(reason)))
   }
 
   /// Return a `Deferred` whose determination will occur at most `ns` nanoseconds from the time of evaluation.


extension Deferred
{
  /// Return a `Deferred` whose determination will occur at least `µs` microseconds from the time of evaluation.
  /// - parameter µs: a number of microseconds
  /// - returns: a `Deferred` reference

  public final func delay(µs: Int) -> Deferred
  {
    return delay64(ns: Int64(µs)*1000)
  }

  /// Return a `Deferred` whose determination will occur at least `ms` milliseconds from the time of evaluation.
  /// - parameter ms: a number of milliseconds
  /// - returns: a `Deferred` reference

  public final func delay(ms: Int) -> Deferred
  {
    return delay64(ns: Int64(ms)*1_000_000)
  }

  /// Return a `Deferred` whose determination will occur at least a number of seconds from the time of evaluation.
  /// - parameter seconds: a number of seconds as a `Double` or `NSTimeInterval`
  /// - returns: a `Deferred` reference

  public final func delay(seconds s: Double) -> Deferred
  {
    return delay64(ns: Int64(s*1e9))
  }

  /// Return a `Deferred` whose determination will occur at least `ns` nanoseconds from the time of evaluation.
  /// - parameter ns: a number of nanoseconds
  /// - returns: a `Deferred` reference

  public final func delay(ns: Int) -> Deferred
  {
    return delay64(ns: Int64(ns))
  }

  private func delay64(ns: Int64) -> Deferred
  {
    if ns < 0 { return self }
    return Delayed(source: self, until: DispatchTime(DispatchTime.now().rawValue + UInt64(max(ns,0))))
  }
}

extension DispatchTime
{
  // FIXME: eliminate this workaround
  public init(_ rawValue: dispatch_time_t)
  {
    self.rawValue = rawValue
  }
}


// MARK: maximum time until a `Deferred` becomes determined



extension Deferred
{
  /// Return a `Deferred` whose determination will occur at most a number of seconds from the time of evaluation.
  /// If `self` has not become determined after the timeout delay, the new `Deferred` will be canceled.
  /// - parameter seconds: a number of seconds as a `Double` or `NSTimeInterval`
