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

        timer = Timer.scheduledTimer(timeInterval: interval, target: self, selector: #selector(increment), userInfo: nil, repeats: true)
        timer?.fire()
    }
    
    public func endCounting() {
        timer?.invalidate()
        timer = nil
        automaticDelegate?.counter(self, didFinishCounting: value)
    }
    
    @objc private func increment() {

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