refactor(cli): use more semantic Instant::elapsed (#1307)

Plus, one of these was incorrectly subtracting the end time from the start time.
This commit is contained in:
Brian Donovan 2023-08-07 09:08:51 -07:00 committed by GitHub
parent 56c3dcc437
commit a025617db3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -236,10 +236,9 @@ pub fn build(config: &CrateConfig, quiet: bool) -> Result<BuildResult> {
}
}
let t_end = std::time::Instant::now();
Ok(BuildResult {
warnings: warning_messages,
elapsed_time: (t_end - t_start).as_millis(),
elapsed_time: t_start.elapsed().as_millis(),
})
}
@ -360,7 +359,7 @@ pub fn build_desktop(config: &CrateConfig, _is_serve: bool) -> Result<BuildResul
Ok(BuildResult {
warnings: warning_messages,
elapsed_time: (t_start - std::time::Instant::now()).as_millis(),
elapsed_time: t_start.elapsed().as_millis(),
})
}