scope: &Scope<'a>,
jobserver_helper: &HelperThread,
) -> CargoResult<()> {
- use std::time::Instant;
-
let mut tokens = Vec::new();
let mut queue = Vec::new();
trace!("queue: {:#?}", self.queue);
// successful and otherwise wait for pending work to finish if it failed
// and then immediately return.
let mut error = None;
- let start_time = Instant::now();
loop {
// Dequeue as much work as we can, learning about everything
// possible that can run. Note that this is also the point where we
if profile.debuginfo.is_some() {
opt_type += " + debuginfo";
}
- let duration = start_time.elapsed();
+ let duration = cx.config.creation_time().elapsed();
let time_elapsed = format!(
"{}.{1:.2} secs",
duration.as_secs(),
use std::path::{Path, PathBuf};
use std::str::FromStr;
use std::sync::{Once, ONCE_INIT};
+use std::time::Instant;
use curl::easy::Easy;
use jobserver;
easy: LazyCell<RefCell<Easy>>,
/// Cache of the `SourceId` for crates.io
crates_io_source_id: LazyCell<SourceId>,
+ creation_time: Instant,
}
impl Config {
cli_flags: CliUnstable::default(),
easy: LazyCell::new(),
crates_io_source_id: LazyCell::new(),
+ creation_time: Instant::now(),
}
}
{
Ok(self.crates_io_source_id.try_borrow_with(f)?.clone())
}
+
+ pub fn creation_time(&self) -> Instant {
+ self.creation_time
+ }
}
#[derive(Eq, PartialEq, Clone, Copy)]