lib/ruby-progressbar/components/timer.rb in ruby-progressbar-1.4.0 vs lib/ruby-progressbar/components/timer.rb in ruby-progressbar-1.4.1
- old
+ new
@@ -9,9 +9,11 @@
@started_at = stopped? ? now - (@stopped_at - @started_at) : now
@stopped_at = nil
end
def stop
+ return unless started?
+
@stopped_at = now
end
def pause
stop