Skip to content

Commit

Permalink
Measure console scroll speed (osbook_day09d)
Browse files Browse the repository at this point in the history
  • Loading branch information
gifnksm committed May 18, 2021
1 parent 262083d commit 36c743d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/console.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,10 +265,10 @@ pub(crate) async fn handler_task() {
layer_id,
height: layer::CONSOLE_HEIGHT,
})?;
layer_tx.send(LayerEvent::Draw { bench: false })?;
layer_tx.send(LayerEvent::Draw { bench: true })?;

while let Some(()) = rx.next().await {
layer_tx.send(LayerEvent::Draw { bench: false })?;
layer_tx.send(LayerEvent::Draw { bench: true })?;
}

Ok::<(), Error>(())
Expand Down
4 changes: 2 additions & 2 deletions src/mouse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,14 @@ pub(crate) fn handler_task() -> impl Future<Output = ()> {
layer_id,
height: layer::MOUSE_CURSOR_HEIGHT,
})?;
tx.send(LayerEvent::Draw { bench: true })?;
tx.send(LayerEvent::Draw { bench: false })?;

while let Some(event) = rx.next().await {
tx.send(LayerEvent::MoveRelative {
layer_id,
diff: event.displacement,
})?;
tx.send(LayerEvent::Draw { bench: true })?;
tx.send(LayerEvent::Draw { bench: false })?;
}

Ok::<(), Error>(())
Expand Down

0 comments on commit 36c743d

Please sign in to comment.