Refactored, calc cycle minus blocked time in Ruby.