This mixin added to Time::Span adds two to_s overloads that works similarly to Time#to_s(format : String).
-
Add the dependency to your
shard.yml:dependencies: time-span-format: github: jgaskins/time-span-format
-
Run
shards install
require "time-span-format"
duration = Time.measure do
# do some work
end
puts duration.to_s("%h hours, %m minutes, %s seconds")TODO: Write usage instructions here
TODO: Write development instructions here
- Fork it (https://github.com/jgaskins/time-span-format/fork)
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
- Jamie Gaskins - creator and maintainer