#[cfg(feature = "tracy")]
use tracy_client::Client;
pub struct TracyZoneGuard {
#[cfg(feature = "tracy")]
_span: tracy_client::Span,
#[cfg(not(feature = "tracy"))]
_no_copy: std::marker::PhantomData<()>,
}
#[inline]
pub fn tracy_zone(_name: &'static str) -> TracyZoneGuard {
#[cfg(feature = "tracy")]
{
let client = Client::start();
let span = client.span_alloc(Some(_name), "windjammer", file!(), line!(), 0);
TracyZoneGuard { _span: span }
}
#[cfg(not(feature = "tracy"))]
{
TracyZoneGuard {
_no_copy: std::marker::PhantomData,
}
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn tracy_zone_no_panic_without_feature() {
{
let _z = tracy_zone("unit_test_zone");
}
}
}