Sha256: 864686c142bca9912893451c56038cfa1c0ac0b5926fe4d45604334a38d52f7c

Contents?: true

Size: 1.14 KB

Versions: 32

Compression:

Stored size: 1.14 KB

Contents

# Some classes used in measurement tests
require 'singleton'

module RubyProf
  class C1
    def C1.sleep_wait
      sleep(0.1)
    end

    def C1.busy_wait
      starting = Process.clock_gettime(Process::CLOCK_MONOTONIC)
      while (Process.clock_gettime(Process::CLOCK_MONOTONIC) - starting) < 0.1
      end
    end

    def sleep_wait
      sleep(0.2)
    end

    def busy_wait
      starting = Process.clock_gettime(Process::CLOCK_MONOTONIC)
      while (Process.clock_gettime(Process::CLOCK_MONOTONIC) - starting) < 0.2
      end
    end
  end

  module M1
    def sleep_wait
      sleep(0.3)
    end

    def busy_wait
      starting = Process.clock_gettime(Process::CLOCK_MONOTONIC)
      while (Process.clock_gettime(Process::CLOCK_MONOTONIC) - starting) < 0.3
      end
    end
  end

  class C2
    include M1
    extend M1
  end

  class C3
    include Singleton
    def sleep_wait
      sleep(0.3)
    end

    def busy_wait
      starting = Process.clock_gettime(Process::CLOCK_MONOTONIC)
      while (Process.clock_gettime(Process::CLOCK_MONOTONIC) - starting) < 0.2
      end
    end
  end
end

Version data entries

32 entries across 32 versions & 2 rubygems

Version Path
ruby-prof-1.7.1-x64-mingw-ucrt test/measure_times.rb
ruby-prof-1.7.1 test/measure_times.rb
ruby-prof-1.7.0-x64-mingw-ucrt test/measure_times.rb
ruby-prof-1.7.0 test/measure_times.rb
honeybadger-5.4.0 vendor/bundle/ruby/3.2.0/gems/ruby-prof-1.6.3/test/measure_times.rb
honeybadger-5.3.0 vendor/bundle/ruby/3.2.0/gems/ruby-prof-1.6.3/test/measure_times.rb
ruby-prof-1.6.3-x64-mingw-ucrt test/measure_times.rb
ruby-prof-1.6.3 test/measure_times.rb
ruby-prof-1.6.2-x64-mingw-ucrt test/measure_times.rb
ruby-prof-1.6.2 test/measure_times.rb
ruby-prof-1.6.1 test/measure_times.rb
ruby-prof-1.6.1-x64-mingw-ucrt test/measure_times.rb
ruby-prof-1.5.0-x64-mingw-ucrt test/measure_times.rb
ruby-prof-1.5.0 test/measure_times.rb
ruby-prof-1.4.5-x64-mingw-ucrt test/measure_times.rb
ruby-prof-1.4.5 test/measure_times.rb
ruby-prof-1.4.4-x64-mingw-ucrt test/measure_times.rb
ruby-prof-1.4.4 test/measure_times.rb
ruby-prof-1.4.3-x64-mingw32 test/measure_times.rb
ruby-prof-1.4.3 test/measure_times.rb