         timer = Timer.scheduledTimer(timeInterval: interval, target: self, selector: #selector(increment), userInfo: nil, repeats: true)
         timer?.fire()
     }
+    public func startCounting(endingAfter end: TimeInterval?) {
+        self.endTime = end
+        startCounting()
+    }
     
     public func endCounting() {
         timer?.invalidate()
         timer = nil
         automaticDelegate?.counter(self, didFinishCounting: value)
+    }
+    public override func reset() {
+        super.reset()
+        timeValue = 0
     }
     
     @objc private func increment() {

    public var automaticDelegate: AutomaticCounterDelegate?
    
    var endValue: Int?
    var interval: TimeInterval
    var autoIncrement: Countable
    var timer: Timer?
    
    public init(startIn start: Int, interval: TimeInterval = 1.0, autoIncrement: Countable = 1) {
        self.interval = interval
        self.autoIncrement = autoIncrement
        super.init(startIn: start)
    }
    

            endCounting()
            return
        }
        if let endTime = endTime, timeValue >= endTime {
            endCounting()
            return
        }
        increment(autoIncrement)
        timeValue += interval
    }
}
