Debian Codegraph @

third_party/rust/profiling/src/empty_impl.rs

raw
1 /// Opens a scope. Two variants:
2 /// - profiling::scope!(name: &str) - Opens a scope with the given name
3 /// - profiling::scope!(name: &str, data: &str) - Opens a scope with the given name and an extra
4 /// datafield. Details of this depend on the API, but it should be a &str. If the extra data is
5 /// named, it will be named "tag". Some APIs support adding more data (for example, `optic::tag!`)
6 ///
7 /// ```
8 /// profiling::scope!("outer");
9 /// for _ in 0..10 {
10 /// profiling::scope!("inner", format!("iteration {}").as_str());
11 /// }
12 /// ```
13 #[macro_export]
14 macro_rules! scope {
15 ($name:expr) => {};
16 ($name:expr, $data:expr) => {};
17 }
18
19 /// Registers a thread with the profiler API(s). This is usually setting a name for the thread.
20 /// Two variants:
21 /// - register_thread!() - Tries to get the name of the thread, or an ID if no name is set
22 /// - register_thread!(name: &str) - Registers the thread using the given name
23 #[macro_export]
24 macro_rules! register_thread {
25 () => {};
26 ($name:expr) => {};
27 }
28
29 /// Finishes the frame. This isn't strictly necessary for some kinds of applications but a pretty
30 /// normal thing to track in games.
31 #[macro_export]
32 macro_rules! finish_frame {
33 () => {};
34 }