absolute_time 0.1.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Binary file
@@ -1,6 +1,4 @@
1
- # encoding: utf-8
2
-
3
- AbsoluteTime
1
+ # AbsoluteTime
4
2
 
5
3
  This gem provides a monotonically increasing timer to permit safe measurement of time intervals.
6
4
 
@@ -20,25 +18,40 @@ with a value recorded by a different process on the same machine.
20
18
 
21
19
  The resolution of the timer is system-dependent.
22
20
 
21
+ ## Usage:
23
22
 
24
- Usage:
25
-
26
- # Is a monotonically increasing timer available on this system?
27
- >> AbsoluteTime.monotonic?
28
- => true
29
-
30
- # Time an action by recording the start and end times.
31
- >> start_time = AbsoluteTime.now
32
- >> value = function_that_takes_a_long_time()
33
- >> end_time = AbsoluteTime.now
34
- >> puts "Function took #{end_time - start_time} seconds to complete."
23
+ # Is a monotonically increasing timer available on this system?
24
+ >> AbsoluteTime.monotonic?
25
+ => true
35
26
 
36
- Function took 5.0002783499658108 seconds to complete.
27
+ # Time an action by recording the start and end times.
28
+ >> start_time = AbsoluteTime.now
29
+ >> value = function_that_takes_a_long_time()
30
+ >> end_time = AbsoluteTime.now
31
+ >> puts "Function took #{end_time - start_time} seconds to complete."
32
+
33
+ Function took 5.0002783499658108 seconds to complete.
37
34
 
38
- # Time an action using AbsoluteTime.measure, which acts like Benchmark.measure.
39
- >> AbsoluteTime.measure { function_that_takes_a_long_time() }
40
- => 5.0002783499658108
35
+ # Time an action using AbsoluteTime.realtime, which acts like Benchmark.realtime.
36
+ >> AbsoluteTime.realtime { function_that_takes_a_long_time() }
37
+ => 5.0002783499658108
41
38
 
42
39
  Supported platforms: Darwin (Mac OS X), FreeBSD, Linux
43
40
 
44
41
  If you can add support for another platform, please do so and send me a pull request on GitHub. A Windows implementation using GetTickCount64() / GetTickCount() / QueryPerformanceCounter() would be much appreciated!
42
+
43
+ ## Signed Gem
44
+
45
+ For your protection, this gem is cryptographically signed by the author. The signing certificate is available at:
46
+
47
+ https://raw.github.com/bwbuchanan/absolute_time/master/gem-public_cert.pem
48
+
49
+ You can add this certificate to your local list of trusted gem signers by running these commands:
50
+
51
+ curl -O https://raw.github.com/bwbuchanan/absolute_time/master/gem-public_cert.pem
52
+ gem cert --add gem-public_cert.pem
53
+
54
+ And once you have done that, you can take advantage of RubyGems' signed gem security by installing
55
+ the gem with this command:
56
+
57
+ gem install absolute_time -P HighSecurity
@@ -1,9 +1,9 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  Gem::Specification.new do |s|
3
3
  s.name = "absolute_time"
4
- s.version = '0.1.0'
4
+ s.version = '1.0.0'
5
5
  s.authors = ["Brian Buchanan"]
6
- s.email = ["brian@tiogalake.com"]
6
+ s.email = ["bwb@holo.org"]
7
7
  s.homepage = ""
8
8
  s.summary = %q{Reliable monotonically increasing timer for measuring time intervals}
9
9
  s.description = %q{This gem provides a monotonically increasing timer to permit safe measurement of time intervals.
@@ -19,11 +19,15 @@ this module.
19
19
  }
20
20
 
21
21
  s.rubyforge_project = "absolute_time"
22
+ s.licenses = ['BSD']
23
+ s.homepage = 'https://github.com/bwbuchanan/absolute_time'
22
24
 
23
25
  s.files = `git ls-files`.split("\n")
24
26
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
25
27
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
26
- s.extensions = 'extconf.rb'
28
+ s.extensions = 'ext/extconf.rb'
27
29
  s.has_rdoc = true
28
- s.extra_rdoc_files = `git ls-files -- *.c`.split("\n")
30
+ s.extra_rdoc_files = `git ls-files -- ext/*.c`.split("\n")
31
+ s.cert_chain = ['gem-public_cert.pem']
32
+ s.signing_key = "#{ENV['HOME']}/.keys/gem-private_key.pem"
29
33
  end
@@ -42,7 +42,7 @@ static double get_absolute_time(void);
42
42
 
43
43
  /*
44
44
  * call-seq:
45
- * AbsoluteTime.now() -> time
45
+ * AbsoluteTime.now() -> float
46
46
  *
47
47
  * Returns the current value of the system timer as a floating-point number of seconds.
48
48
  * Although the units of the return value are seconds, they cannot be safely
@@ -61,7 +61,7 @@ module_now(VALUE self_)
61
61
 
62
62
  /*
63
63
  * call-seq:
64
- * AbsoluteTime.realtime() { || ... } -> seconds
64
+ * AbsoluteTime.realtime() { || ... } -> float
65
65
  *
66
66
  * Like Benchmark.realtime(), returns the elapsed time to execute the specified block,
67
67
  * as a floating-point number of seconds.
@@ -80,7 +80,7 @@ module_realtime(VALUE self_)
80
80
 
81
81
  /*
82
82
  * call-seq:
83
- * AbsoluteTime.monotonic?() -> true | false
83
+ * AbsoluteTime.monotonic?() -> Boolean
84
84
  *
85
85
  * Returns true if this module is able to use a guaranteed monotonically-increasing clock,
86
86
  * false otherwise.
File without changes
@@ -0,0 +1,20 @@
1
+ -----BEGIN CERTIFICATE-----
2
+ MIIDWDCCAkCgAwIBAgIBATANBgkqhkiG9w0BAQUFADA5MQwwCgYDVQQDDANid2Ix
3
+ FDASBgoJkiaJk/IsZAEZFgRob2xvMRMwEQYKCZImiZPyLGQBGRYDb3JnMB4XDTEz
4
+ MDIwNjE5MzU1OVoXDTIzMDIwNDE5MzU1OVowOTEMMAoGA1UEAwwDYndiMRQwEgYK
5
+ CZImiZPyLGQBGRYEaG9sbzETMBEGCgmSJomT8ixkARkWA29yZzCCASIwDQYJKoZI
6
+ hvcNAQEBBQADggEPADCCAQoCggEBAKWKWUi+FyWhaDG5NUHIb0lxFkT+kfAi0NV1
7
+ eRx2I/JkNg4jzRlJF3rH8+ZtcgM8FGCY7bj+pbpXoP/2dqtXmJ7u2bjBO097xXrn
8
+ G1pktrqZdmNCvbkQZpaXe9X61tSQJsjglrIUJvXYcIEUZ+7nD1XUrw5sPeXZ7AFI
9
+ Ep3UGHAwI5Uh3B57bzaQENJea52uPvcH246bEw3QCMXP3TK6FRWR7PU5J3eugUU5
10
+ y7N00INs2NjnbfIrqaEC87gIpaOjMKbfTTVdSgVh2MC+sscimISsiyrayW7/IB+q
11
+ 0XP/v4s9AFEM7Yn2j2GsWHNS+vMt9xXZReYseeqoACvVZbC75EcCAwEAAaNrMGkw
12
+ CQYDVR0TBAIwADALBgNVHQ8EBAMCBLAwHQYDVR0OBBYEFMkCi8HQi9IoAnT/qbxG
13
+ hsWdnFK7MBcGA1UdEQQQMA6BDGJ3YkBob2xvLm9yZzAXBgNVHRIEEDAOgQxid2JA
14
+ aG9sby5vcmcwDQYJKoZIhvcNAQEFBQADggEBAGeGVOHQHUCbEt3AuhW9NcsWJHqS
15
+ vTIp7j53LKLos4NcjpTP+Ou4kav+Wd3Kie+R/t3CpWR2ikdkMn/gQGQscCuYdYGc
16
+ 3o5CGXq40uQP4DWmkWiHDLe3w4j/Lge+78JVdHfBTjMEJpL8SjOIu3Ro0Vbl+6BV
17
+ wPRZeEECODbxsUl/0xgloy/wE1Lov9O585H4YPFyKVl6o/OAQEwAuECqClIwyBOf
18
+ RSzK6FH5nog+gjmernhhTI39Fevn/MXXt/mCzgo//Gd3EyYhn7jVlhAC0GWyIpJ9
19
+ OX/k+uZl36b+q6VSxqMuBYz4vG6G5M0ajty76k23UixUOv8w3aX54VjEAyo=
20
+ -----END CERTIFICATE-----
metadata CHANGED
@@ -1,15 +1,44 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: absolute_time
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 1.0.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
8
8
  - Brian Buchanan
9
9
  autorequire:
10
10
  bindir: bin
11
- cert_chain: []
12
- date: 2011-09-17 00:00:00.000000000Z
11
+ cert_chain:
12
+ - !binary |-
13
+ LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURXRENDQWtDZ0F3SUJB
14
+ Z0lCQVRBTkJna3Foa2lHOXcwQkFRVUZBREE1TVF3d0NnWURWUVFEREFOaWQy
15
+ SXgKRkRBU0Jnb0praWFKay9Jc1pBRVpGZ1JvYjJ4dk1STXdFUVlLQ1pJbWla
16
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M0F1aFc5TmNzV0pIcVMKdlRJcDdqNTNMS0xvczROY2pwVFArT3U0a2F2
33
+ K1dkM0tpZStSL3QzQ3BXUjJpa2RrTW4vZ1FHUXNjQ3VZZFlHYwozbzVDR1hx
34
+ NDB1UVA0RFdta1dpSERMZTN3NGovTGdlKzc4SlZkSGZCVGpNRUpwTDhTak9J
35
+ dTNSbzBWYmwrNkJWCndQUlplRUVDT0RieHNVbC8weGdsb3kvd0UxTG92OU81
36
+ ODVINFlQRnlLVmw2by9PQVFFd0F1RUNxQ2xJd3lCT2YKUlN6SzZGSDVub2cr
37
+ Z2ptZXJuaGhUSTM5RmV2bi9NWFh0L21DemdvLy9HZDNFeVlobjdqVmxoQUMw
38
+ R1d5SXBKOQpPWC9rK3VabDM2YitxNlZTeHFNdUJZejR2RzZHNU0wYWp0eTc2
39
+ azIzVWl4VU92OHczYVg1NFZqRUF5bz0KLS0tLS1FTkQgQ0VSVElGSUNBVEUt
40
+ LS0tLQo=
41
+ date: 2013-02-06 00:00:00.000000000 Z
13
42
  dependencies: []
14
43
  description: ! 'This gem provides a monotonically increasing timer to permit safe
15
44
  measurement of time intervals.
@@ -38,22 +67,24 @@ description: ! 'This gem provides a monotonically increasing timer to permit saf
38
67
 
39
68
  '
40
69
  email:
41
- - brian@tiogalake.com
70
+ - bwb@holo.org
42
71
  executables: []
43
72
  extensions:
44
- - extconf.rb
73
+ - ext/extconf.rb
45
74
  extra_rdoc_files:
46
- - absolute_time.c
75
+ - ext/absolute_time.c
47
76
  files:
48
77
  - .gitignore
49
78
  - Gemfile
50
- - README
79
+ - README.md
51
80
  - Rakefile
52
- - absolute_time.c
53
81
  - absolute_time.gemspec
54
- - extconf.rb
55
- homepage: ''
56
- licenses: []
82
+ - ext/absolute_time.c
83
+ - ext/extconf.rb
84
+ - gem-public_cert.pem
85
+ homepage: https://github.com/bwbuchanan/absolute_time
86
+ licenses:
87
+ - BSD
57
88
  post_install_message:
58
89
  rdoc_options: []
59
90
  require_paths:
@@ -72,7 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
72
103
  version: '0'
73
104
  requirements: []
74
105
  rubyforge_project: absolute_time
75
- rubygems_version: 1.8.5
106
+ rubygems_version: 1.8.23
76
107
  signing_key:
77
108
  specification_version: 3
78
109
  summary: Reliable monotonically increasing timer for measuring time intervals
Binary file