    # File lib/rubygame/clock.rb, line 280
        def calibrate( max_time = 0.5 )
          samples = []

          end_time = Time.now + max_time

          while( Time.now < end_time )
            t = Time.now
            sleep 0.01
            samples << (Time.now - t - 0.01)
          end

          average = samples.inject{|sum,n| sum + n} / samples.length

          # convert to ms, add some padding
          gran = (average * 1000).to_i + 1

          @granularity = gran

          return nil
        end