Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
E
e7020e_2020
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
Model registry
Operate
Environments
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
Gustav Hansson
e7020e_2020
Commits
6c41109f
Commit
6c41109f
authored
5 years ago
by
Gustav Hansson
Browse files
Options
Downloads
Patches
Plain Diff
bare 2
parent
b06929c0
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
examples/bare2.rs
+11
-5
11 additions, 5 deletions
examples/bare2.rs
with
11 additions
and
5 deletions
examples/bare2.rs
+
11
−
5
View file @
6c41109f
...
...
@@ -18,7 +18,7 @@ use panic_halt as _;
use
cortex_m
::{
iprintln
,
peripheral
::
DWT
,
Peripherals
};
use
cortex_m_rt
::
entry
;
// burns CPU cycles by just looping `i` times
// burns CPU cycles by just
5
looping `i` times
#[inline(never)]
fn
wait
(
i
:
u32
)
{
for
_
in
0
..
i
{
...
...
@@ -77,18 +77,24 @@ fn main() -> ! {
//
// What is the output in the ITM console?
//
// ** your answer here **
//
// bare2
// Start 2012359631
// End 2139359709
// Diff 127000078
//
// Rebuild and run in release mode
//
// > cargo build --example bare2 --release
//
// ** your answer here **
// bare2
// Start 3019839635
// End 3026839650
// Diff 7000015
//
// Compute the ratio between debug/release optimized code
// (the speedup).
//
//
** your answer here **
//
18,1428 times faster
//
// commit your answers (bare2_1)
//
...
...
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