Timetrace
A lightweight Rust profiling library inspired by Hazel and Tracy-style instrumentation.
Generates JSON traces compatible with Chrome Tracing and Perfetto.
Features
- RAII profiling (scope-based)
- Function attribute macro:
#[profile_function] - Session management:
#[profile_session] - Frame indexing in trace (
args.frame) - Minimal overhead
- Thread-aware (thread id included)
Example
use ;
Run
View Trace
Open in:
- https://ui.perfetto.dev
- Only in Google Chrome: chrome://tracing
Output Example
(Actual output is written as a single line JSON)
Cargo Features
Enable macros:
= { = "...", = ["macros"] }
(macros are enabled by default)
Disable macros:
= { = "...", = false }
License
Copyright 2026 Gleb Petrikov
Licensed under Apache-2.0