| Crates.io | time_requirements |
| lib.rs | time_requirements |
| version | 0.1.0 |
| created_at | 2026-01-06 09:29:31.811317+00 |
| updated_at | 2026-01-06 09:29:31.811317+00 |
| description | Crate to measure time requirements of steps in your code. |
| homepage | https://github.com/earth-metabolome-initiative/time_requirements |
| repository | https://github.com/earth-metabolome-initiative/time_requirements |
| max_upload_size | |
| id | 2025498 |
| size | 49,824 |
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.
use std::{thread, time::Duration};
use time_requirements::prelude::*;
let mut tracker = TimeTracker::new("My Project");
// Start tracking a task
let task = Task::new("Heavy Computation");
// Simulate work
thread::sleep(Duration::from_millis(100));
// Complete the task and add it to the tracker
tracker.add_completed_task(task);
// You can also use sub-trackers for logical grouping
let mut sub_tracker = TimeTracker::new("Database Operations");
let sub_task = Task::new("Query");
// ... perform query ...
sub_tracker.add_completed_task(sub_task);
// Merge sub-tracker into the main tracker
tracker.extend(sub_tracker);
// Save the report to a file
tracker.write("report.md").unwrap();
This creates a markdown report of the time spent on tasks, which you can see an example of in
report.md.
save()