mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 06:22:22 -04:00
Add timer for build_queues()
This commit is contained in:
parent
694f9adf0c
commit
c9f5fc6ebe
1 changed files with 10 additions and 1 deletions
|
@ -7,7 +7,10 @@ pub(crate) mod intersperser;
|
|||
pub(crate) mod sized_chain;
|
||||
mod sorting;
|
||||
|
||||
use std::collections::{HashMap, VecDeque};
|
||||
use std::{
|
||||
collections::{HashMap, VecDeque},
|
||||
time::Instant,
|
||||
};
|
||||
|
||||
use intersperser::Intersperser;
|
||||
use sized_chain::SizedChain;
|
||||
|
@ -207,6 +210,8 @@ fn sort_learning(mut learning: Vec<DueCard>) -> VecDeque<LearningQueueEntry> {
|
|||
|
||||
impl Collection {
|
||||
pub(crate) fn build_queues(&mut self, deck_id: DeckId) -> Result<CardQueues> {
|
||||
let start_time = Instant::now();
|
||||
|
||||
let mut ctx = Context::new(self, deck_id)?;
|
||||
self.storage.update_active_decks(&ctx.root_deck)?;
|
||||
let mut queues = QueueBuilder::new(ctx.sort_options.clone());
|
||||
|
@ -233,6 +238,10 @@ impl Collection {
|
|||
ctx.timing.days_elapsed,
|
||||
);
|
||||
|
||||
println!(
|
||||
"build_queues() took {} ms",
|
||||
start_time.elapsed().as_millis()
|
||||
);
|
||||
Ok(queues)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue