Sha256: cda38132f0923986bfed9c86014e4903ca297bbc2b1e1008c9c5a935af06812f
Contents?: true
Size: 596 Bytes
Versions: 6
Compression:
Stored size: 596 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 def 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
6 entries across 6 versions & 1 rubygems