Sha256: 5a8aec73a92b14a7a57d88a40d459b3b043861b2d895342621120ddf0ec2405d

Contents?: true

Size: 516 Bytes

Versions: 8

Compression:

Stored size: 516 Bytes

Contents

require 'spec_helper'

describe Hitimes do
  it "can time a block of code" do
    d = Hitimes.measure do
      sleep 0.2
    end
    d.must_be_close_to(0.2, 0.002)
  end

  it "raises an error if measure is called with no block" do
    lambda{ Hitimes.measure }.must_raise( Hitimes::Error )
  end

  it "has the raw instant value" do
    v = Hitimes.raw_instant
    v.must_be :>, 0
  end

  it "has access to the instant conversion factor" do
    f = Hitimes::INSTANT_CONVERSION_FACTOR
    f.must_be :>, 0
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
hitimes-1.3.1-x64-mingw32 spec/hitimes_spec.rb
hitimes-1.3.1-x86-mingw32 spec/hitimes_spec.rb
hitimes-1.3.1-java spec/hitimes_spec.rb
hitimes-1.3.1 spec/hitimes_spec.rb
hitimes-1.3.0-x64-mingw32 spec/hitimes_spec.rb
hitimes-1.3.0-x86-mingw32 spec/hitimes_spec.rb
hitimes-1.3.0-java spec/hitimes_spec.rb
hitimes-1.3.0 spec/hitimes_spec.rb