compsci 0.3.2.3 → 0.3.2.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/VERSION +1 -1
  3. data/lib/compsci/timer.rb +7 -7
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 265cce45b9c0791d768d79d890bdfd3b2f3dd0f9d3b5346798274095bd38efa1
4
- data.tar.gz: c921f58718dc3df31cb89572a9b428cbf9add53e6ed8d7b3f433fb8eb4dde0a4
3
+ metadata.gz: c6988acf55d6b28d2e24ba9ac8d549287bc841d2be362293a000ffadf3e75c77
4
+ data.tar.gz: b5f95b5678b3e509d5097e96727994451952cd52aa32ef0a628f383ee924af20
5
5
  SHA512:
6
- metadata.gz: 6f7bf484573f12573ed1f3705634aacd3f7c47508df8983e5bfe92908923d4bf9495dc3ae65deb69749fa326185ec08a8233dd2689f4b400db553a65d2272708
7
- data.tar.gz: c5db4b1e31b10b031dec20a21806fae10853ad7cd9bc62817f374fbef10df4934d1a16c6ea1d9a7d0ebb3c46f9c470077984d983f94755a417a130330d101431
6
+ metadata.gz: dade867140e16eb11f9092e87c7a464a580ae96e2f01902e155ea24f7a0247379ff355d16cd58a8a0dd2ed21a9c725a99fce649f91d3b0e0ed8a03e7d83f6b95
7
+ data.tar.gz: f698945fd3d66d07a239162bfca91c5b7201f26f8353e27882139e048c6110c8134f3206a827d171873792937d55ae3f777124893a356f9c4c66aaac51d0fae1
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.2.3
1
+ 0.3.2.4
data/lib/compsci/timer.rb CHANGED
@@ -38,7 +38,7 @@ module CompSci
38
38
  end
39
39
 
40
40
  # YYYY-MM-DD HH::MM::SS.mmm
41
- def self.timestamp(t)
41
+ def self.timestamp(t = Time.now)
42
42
  t.strftime "%Y-%m-%d %H:%M:%S.%L"
43
43
  end
44
44
 
@@ -57,7 +57,7 @@ module CompSci
57
57
  hmsms.join('.')
58
58
  end
59
59
 
60
- def restart(t = Time.now)
60
+ def restart(t = Timer.now)
61
61
  @start = t
62
62
  self
63
63
  end
@@ -71,25 +71,25 @@ module CompSci
71
71
  puts '-' * 70, timestamp(t), '-' * 70
72
72
  end
73
73
 
74
- def elapsed(t = Time.now)
74
+ def elapsed(t = Timer.now)
75
75
  t - @start
76
76
  end
77
77
 
78
- def elapsed_ms(t = Time.now)
78
+ def elapsed_ms(t = Timer.now)
79
79
  elapsed(t) * 1000
80
80
  end
81
81
 
82
- def elapsed_display(t = Time.now)
82
+ def elapsed_display(t = Timer.now)
83
83
  self.class.elapsed_display(elapsed_ms(t))
84
84
  end
85
85
  alias_method :to_s, :elapsed_display
86
86
  alias_method :inspect, :elapsed_display
87
87
 
88
- def stamp(msg = '', t = Time.now)
88
+ def stamp(msg = '', t = Timer.now)
89
89
  format("%s %s", elapsed_display(t), msg)
90
90
  end
91
91
 
92
- def stamp!(msg = '', t = Time.now)
92
+ def stamp!(msg = '', t = Timer.now)
93
93
  puts stamp(msg, t)
94
94
  end
95
95
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: compsci
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2.3
4
+ version: 0.3.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rick Hull