What is this?
I needed a way to time code segments from various different parts of my programs but track them with a singular list for later output. For instance, I time render code, database code, and other code during a web request then include the output in the page itself for debugging.
Example:
let mut stopwatch = new;
some_long_task;
stopwatch.finish;
println!;
OK but...?
You could've accomplished the above with just std::time::Instant (which this code uses),
but now let's use our threadsafe shared list to make it more useful:
// Clones of OneList are threadsafe reference-counted pointers to the original list
// stored here in 'all_timings'
let all_timings = new;
let service1 = Service1 ;
let service2 = Service2 ;
service1.do_stuff;
service2.do_stuff;
// Both go to the same list, which you can then print out somewhere later
assert_eq;
No but for real
Yes, the library is basically useless!