Rdcpu16 0.0.1 → 0.0.2

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.
data/lib/dcpu16/cpu.rb CHANGED
@@ -62,6 +62,13 @@ module DCPU16
62
62
  end
63
63
  end
64
64
 
65
+ # Current clock_cycle
66
+ def hz
67
+ diff = Time.now - (@started_at || Time.now)
68
+ diff = 1 if diff == 0
69
+ @cycle / diff
70
+ end
71
+
65
72
  # Resets the CPU and its sub-systems (registers, memory, ...)
66
73
  def reset
67
74
  @cycle = 0
@@ -1,4 +1,4 @@
1
1
  module DCPU16
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
4
4
 
@@ -0,0 +1,4 @@
1
+ module DCPU16
2
+ VERSION = "0.0.1"
3
+ end
4
+
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: Rdcpu16
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-04-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
16
- requirement: &74148950 !ruby/object:Gem::Requirement
16
+ requirement: &85253420 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: '2.6'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *74148950
24
+ version_requirements: *85253420
25
25
  description: This is a simple Ruby port of the fictive 16-bit-cpu DCPU16.
26
26
  email:
27
27
  - deradon87@gmail.com
@@ -36,6 +36,7 @@ files:
36
36
  - lib/dcpu16/version.rb
37
37
  - lib/dcpu16/cpu/instructions.rb
38
38
  - lib/dcpu16/support/debug.rb
39
+ - lib/dcpu16/version.rb~
39
40
  - lib/dcpu16/literal.rb
40
41
  - lib/dcpu16/instruction.rb
41
42
  - lib/dcpu16/register.rb