Skip to content

Commit

Permalink
Add script to run all days
Browse files Browse the repository at this point in the history
  • Loading branch information
Aeilko committed Dec 9, 2023
1 parent 73694ec commit 7edb8e3
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tools/run_all.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

days_dir = File.join(File.expand_path("."), 'days', '')

total_time = 0

Dir["#{days_dir}day*.rb"].each do |file|
day = file.match(/day(\d\d)\.rb/)
next unless day

day = day[1].to_i
if day > 0 and day < 26
start = Time.now
require file
total_time += (Time.now-start)
end
end

puts "\nTotal runtime:\t#{total_time}s"

0 comments on commit 7edb8e3

Please sign in to comment.