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