Skip to content

Commit becfd55

Browse files
authored
Merge pull request #522 from hatoo/example-fib
Fix examples/fib.rs to use Instant::elapsed
2 parents f169f9c + 9b521b3 commit becfd55

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/fib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ async fn fibsum(req: Request<()>) -> tide::Result<String> {
1717
// Compute the nth number in the fibonacci sequence
1818
let fib_n = fib(n);
1919
// Stop the stopwatch
20-
let duration = Instant::now().duration_since(start).as_secs();
20+
let duration = start.elapsed().as_secs();
2121
// Return the answer
2222
let res = format!(
2323
"The fib of {} is {}.\nIt was computed in {} secs.\n",

0 commit comments

Comments
 (0)