require 'timeout'
class Float
def times
whole, frac = divmod(1)
mean = whole.times.map { |i|
start = Time.now
yield i
Time.now - start
}.reduce(:+) / whole.to_f
return self if frac.zero?
timeout(mean * frac) { yield whole } rescue nil
self
end
end
2.5.times do |i|
"This is sentence ##{i.succ}.\n".each_char do |c|
sleep 0.001 and print c
end
end
cmVxdWlyZSAndGltZW91dCcKCmNsYXNzIEZsb2F0CiAgZGVmIHRpbWVzCiAgICB3aG9sZSwgZnJhYyA9IGRpdm1vZCgxKQogICAgbWVhbiA9IHdob2xlLnRpbWVzLm1hcCB7IHxpfAogICAgICBzdGFydCA9IFRpbWUubm93CiAgICAgIHlpZWxkIGkKICAgICAgVGltZS5ub3cgLSBzdGFydAogICAgfS5yZWR1Y2UoOispIC8gd2hvbGUudG9fZgoKICAgIHJldHVybiBzZWxmIGlmIGZyYWMuemVybz8KICAgIHRpbWVvdXQobWVhbiAqIGZyYWMpIHsgeWllbGQgd2hvbGUgfSByZXNjdWUgbmlsCiAgICBzZWxmCiAgZW5kCmVuZAoKMi41LnRpbWVzIGRvIHxpfAogICJUaGlzIGlzIHNlbnRlbmNlICMje2kuc3VjY30uXG4iLmVhY2hfY2hhciBkbyB8Y3wKICAgIHNsZWVwIDAuMDAxIGFuZCBwcmludCBjCiAgZW5kCmVuZA==