Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
chip-ahoyto
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
João Magalhães
chip-ahoyto
Commits
60168ba0
Verified
Commit
60168ba0
authored
2 years ago
by
João Magalhães
Browse files
Options
Downloads
Patches
Plain Diff
feat: support for cycle count setting
parent
b318f8cc
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#803
passed
2 years ago
Stage: build
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
examples/benchmark/src/main.rs
+10
-3
10 additions, 3 deletions
examples/benchmark/src/main.rs
with
10 additions
and
3 deletions
examples/benchmark/src/main.rs
+
10
−
3
View file @
60168ba0
use
std
::
env
;
use
chip_ahoyto
::{
chip8
::
Chip8
,
chip8_classic
::
Chip8Classic
,
chip8_neo
::
Chip8Neo
,
util
::
read_file
,
};
...
...
@@ -6,6 +8,13 @@ use time::Instant;
const
CYCLE_COUNT
:
u64
=
5_000_000_000
;
fn
main
()
{
let
mut
cycles
=
CYCLE_COUNT
;
let
args
:
Vec
<
String
>
=
env
::
args
()
.collect
();
if
args
.len
()
>
1
{
cycles
=
u64
::
from_str_radix
(
&
args
[
1
],
10
)
.unwrap
();
}
let
chips
:
[
Box
<
dyn
Chip8
>
;
2
]
=
[
Box
::
new
(
Chip8Classic
::
new
()),
Box
::
new
(
Chip8Neo
::
new
())];
let
rom_path
=
"../../res/roms/pong.ch8"
;
...
...
@@ -17,8 +26,6 @@ fn main() {
let
instant
=
Instant
::
now
();
let
cycles
=
CYCLE_COUNT
;
println!
(
"[{}] Running {} cycles for {}"
,
chip8
.name
(),
...
...
@@ -26,7 +33,7 @@ fn main() {
rom_path
);
for
_
in
0
..
CYCLE_COUNT
{
for
_
in
0
..
cycles
{
chip8
.clock
();
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment