Replace instant with web-time

This commit is contained in:
dAxpeDDa 2023-06-01 17:22:28 +02:00 committed by daxpedda
parent cf77f82ae3
commit 5bbe87960e
8 changed files with 22 additions and 8 deletions

View file

@ -1,6 +1,10 @@
#![allow(clippy::single_match)]
use std::{thread, time};
use std::thread;
#[cfg(not(wasm_platform))]
use std::time;
#[cfg(wasm_platform)]
use web_time as time;
use simple_logger::SimpleLogger;
use winit::{
@ -102,7 +106,7 @@ fn main() {
Mode::Wait => control_flow.set_wait(),
Mode::WaitUntil => {
if !wait_cancelled {
control_flow.set_wait_until(instant::Instant::now() + WAIT_TIME);
control_flow.set_wait_until(time::Instant::now() + WAIT_TIME);
}
}
Mode::Poll => {

View file

@ -1,7 +1,10 @@
#![allow(clippy::single_match)]
use instant::Instant;
use std::time::Duration;
#[cfg(not(wasm_platform))]
use std::time::Instant;
#[cfg(wasm_platform)]
use web_time::Instant;
use simple_logger::SimpleLogger;
use winit::{