Time requirements
Simple crate to measure time requirements of steps in your code.
Within our projects, we use this tool primarily to understand which parts of the build process are slow and need to be optimized.
Usage
use ;
use *;
let mut tracker = new;
// Start tracking a task
let task = new;
// Simulate work
sleep;
// Complete the task and add it to the tracker
tracker.add_completed_task;
// You can also use sub-trackers for logical grouping
let mut sub_tracker = new;
let sub_task = new;
// ... perform query ...
sub_tracker.add_completed_task;
// Merge sub-tracker into the main tracker
tracker.extend;
// Save the report to a file
tracker.write.unwrap;
This creates a markdown report of the time spent on tasks, which you can see an example of in
report.md.
Features
- Simple Task Tracking: Measure the duration of individual tasks.
- Hierarchical Reporting: Use sub-trackers to group tasks logically.
- Markdown Reports: Automatically generate readable Markdown reports including:
- Total time spent
- Slowest task analysis
- Detailed table of tasks with time and percentage distributions
- JSON export support via
save()