Skip to content

Commit

Permalink
Corrected README code snippets.
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenmartindale authored and sebcrozet committed Oct 6, 2021
1 parent c7d8e52 commit b79ce7e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ _main.rs_:
```rust
fn main() {
// Will be the same as `std::time::Instant`.
let now = instant::Instant::new();
let now = instant::Instant::now();
}
```

Expand All @@ -51,7 +51,7 @@ _main.rs_:
```rust
fn main() {
// Will emulate `std::time::Instant` based on `performance.now()`.
let now = instant::Instant::new();
let now = instant::Instant::now();
}
```

Expand All @@ -70,7 +70,7 @@ _main.rs_:
```rust
fn main() {
// Will emulate `std::time::Instant` based on `Date.now()`.
let now = instant::Instant::new();
let now = instant::Instant::now();
}
```

Expand All @@ -93,7 +93,7 @@ _lib.rs_:
fn my_function() {
// Will select the proper implementation depending on the
// feature selected by the user.
let now = instant::Instant::new();
let now = instant::Instant::now();
}
```

Expand All @@ -115,7 +115,7 @@ _lib.rs_:
fn my_function() {
// Will select the proper implementation depending on the
// feature selected by the user.
let now_instant = instant::Instant::new();
let now_instant = instant::Instant::now();
let now_milliseconds = instant::now(); // In milliseconds.
}
```
Expand All @@ -131,7 +131,7 @@ _lib.rs_:
```rust
fn my_function() {
// Will use the 'now' javascript implementation.
let now_instant = instant::Instant::new();
let now_instant = instant::Instant::now();
let now_milliseconds = instant::now(); // In milliseconds.
}
```
Expand Down

0 comments on commit b79ce7e

Please sign in to comment.