diff options
author | 2022-11-29 19:50:58 -0800 | |
---|---|---|
committer | 2023-01-09 18:52:38 +0100 | |
commit | c5cd236b7380c3689792934aeaecd2942713fa67 (patch) | |
tree | c27a0e6ecfdec7936791ee70e07ce19c713095cd /examples | |
parent | ba20ac8e49aedfa9d822d71784587d0635cec4f8 (diff) | |
download | iced-c5cd236b7380c3689792934aeaecd2942713fa67.tar.gz iced-c5cd236b7380c3689792934aeaecd2942713fa67.tar.bz2 iced-c5cd236b7380c3689792934aeaecd2942713fa67.zip |
Initial profiling support for Iced.
Diffstat (limited to '')
-rw-r--r-- | examples/integration_wgpu/Cargo.toml | 1 | ||||
-rw-r--r-- | examples/integration_wgpu/src/main.rs | 7 |
2 files changed, 8 insertions, 0 deletions
diff --git a/examples/integration_wgpu/Cargo.toml b/examples/integration_wgpu/Cargo.toml index eaa1df7e..9380f659 100644 --- a/examples/integration_wgpu/Cargo.toml +++ b/examples/integration_wgpu/Cargo.toml @@ -8,6 +8,7 @@ publish = false [dependencies] iced_winit = { path = "../../winit" } iced_wgpu = { path = "../../wgpu", features = ["webgl"] } +iced_profiling = { path = "../../profiling", features = ["tracing-chrome"]} env_logger = "0.8" [target.'cfg(target_arch = "wasm32")'.dependencies] diff --git a/examples/integration_wgpu/src/main.rs b/examples/integration_wgpu/src/main.rs index 70f9a48b..e3dfb6fc 100644 --- a/examples/integration_wgpu/src/main.rs +++ b/examples/integration_wgpu/src/main.rs @@ -16,6 +16,8 @@ use winit::{ event_loop::{ControlFlow, EventLoop}, }; +use iced_profiling::info_span; + #[cfg(target_arch = "wasm32")] use wasm_bindgen::JsCast; #[cfg(target_arch = "wasm32")] @@ -39,6 +41,9 @@ pub fn main() { #[cfg(not(target_arch = "wasm32"))] env_logger::init(); + // Initialize tracing + let _guard = iced_profiling::init(); + // Initialize winit let event_loop = EventLoop::new(); @@ -198,6 +203,8 @@ pub fn main() { } } Event::RedrawRequested(_) => { + let _ = info_span!("Integration_WGPU", "DRAW").entered(); + if resized { let size = window.inner_size(); |