Skip to content

Commit 7edb8e3

Browse files
committed
Add script to run all days
1 parent 73694ec commit 7edb8e3

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

tools/run_all.rb

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
2+
days_dir = File.join(File.expand_path("."), 'days', '')
3+
4+
total_time = 0
5+
6+
Dir["#{days_dir}day*.rb"].each do |file|
7+
day = file.match(/day(\d\d)\.rb/)
8+
next unless day
9+
10+
day = day[1].to_i
11+
if day > 0 and day < 26
12+
start = Time.now
13+
require file
14+
total_time += (Time.now-start)
15+
end
16+
end
17+
18+
puts "\nTotal runtime:\t#{total_time}s"

0 commit comments

Comments
 (0)