Sha256: 17f5c93cb1cd664f4c10dbf9495ec1c4da6d039e456b3d26bab542708a5c9d96

Contents?: true

Size: 597 Bytes

Versions: 23

Compression:

Stored size: 597 Bytes

Contents

class SpecTimer
  def initialize()
    self.start_time = 0
    self.end_time = 0
  end

  defm start()
    self.start_time = reltime()
  end

  defm stop()
    self.end_time = reltime()
    self.duration = self.time_to_ms(reltime(self.start_time))
  end

  defm get_duration()
    return self.duration
  end

  defm time_to_ms(time)
    duration_str = reltimestr(time)
    duration_split = split(duration_str, '\.')
    seconds = str2nr(duration_split[0])
    microseconds = str2nr(duration_split[1])
    milliseconds = (seconds * 1000) + (microseconds / 1000)

    return milliseconds
  end

end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
speckle-0.1.26 lib/utils/spec_timer.riml
speckle-0.1.25 lib/utils/spec_timer.riml
speckle-0.1.24 lib/utils/spec_timer.riml
speckle-0.1.23 lib/utils/spec_timer.riml
speckle-0.1.22 lib/utils/spec_timer.riml
speckle-0.1.21 lib/utils/spec_timer.riml
speckle-0.1.20 lib/utils/spec_timer.riml
speckle-0.1.19 lib/utils/spec_timer.riml
speckle-0.1.18 lib/utils/spec_timer.riml
speckle-0.1.17 lib/utils/spec_timer.riml
speckle-0.1.16 lib/utils/spec_timer.riml
speckle-0.1.15 lib/utils/spec_timer.riml
speckle-0.1.14 lib/utils/spec_timer.riml
speckle-0.1.13 lib/utils/spec_timer.riml
speckle-0.1.12 lib/utils/spec_timer.riml
speckle-0.1.11 lib/utils/spec_timer.riml
speckle-0.1.10 lib/utils/spec_timer.riml
speckle-0.1.9 lib/utils/spec_timer.riml
speckle-0.1.8 lib/utils/spec_timer.riml
speckle-0.1.7 lib/utils/spec_timer.riml