Skip to content

Instantly share code, notes, and snippets.

@auxesis
Last active July 10, 2025 00:07
Show Gist options
  • Save auxesis/54c6dd7f223279ff5fd35b74789c9080 to your computer and use it in GitHub Desktop.
Save auxesis/54c6dd7f223279ff5fd35b74789c9080 to your computer and use it in GitHub Desktop.
require "dotiw"
include DOTIW::Methods
availability = 0.999 # three nines
# days per year
# | hours per day
# | | minutes per hour
# | | | seconds per minute
# | | | |
seconds_per_year = 365 * 24 * 60 * 60 # => 31536000
available_seconds = seconds_per_year * availability # => 31504464
budget = seconds_per_year - available_seconds # => 31536
budget_period_seconds = {
'per day': budget / 365, # => 86.4
'per week': budget / 52, # => 606.4615384615385
'per month': budget / 12, # => 2628
'per quarter': budget / 4, # => 7884
'per year': budget # => 31536
}
budget_period_seconds.each do |period, seconds|
puts [period, distance_of_time_in_words(0, seconds)].join("\t")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment