>> require 'benchmark'
=> true
>> include Benchmark
=> Object
>> bmbm(100) do |x|
?>     x.report('Check every char is number') do
?>       !!"this is just a test".match(/\A[0-9]+\Z/)
>>     end
>>   x.report('Check it does not contain word characters') do
?>       !"this is just a test".match(/[^0-9]/)
>>     end
>>   end
Rehearsal ---------------------------------------------------------------------------------------------------------------------------------------
Check every char is number                                                                            0.000000   0.000000   0.000000 (  0.000023)
Check it does not contain word characters                                                             0.000000   0.000000   0.000000 (  0.000011)
------------------------------------------------------------------------------------------------------------------------------ total: 0.000000sec

                                                                                                          user     system      total        real
Check every char is number                                                                            0.000000   0.000000   0.000000 (  0.001136)
Check it does not contain word characters                                                             0.000000   0.000000   0.000000 (  0.000067)