This usage:
- You have one logger, and want to profile it:
- you want to know how much time is spent while logging
- Test: dump some dummy string 5000 times, and then the profiling information is written to "profile.txt"
- The logger has several log destinations
- The output goes to console, debug output window, and a file called out.txt
- Formatting - prefix each message by its index, and append newline
Optimizations:
- use a cache string (from optimize namespace), in order to make formatting the message faster
If logging on dedicated thread, the output for "profile.txt" could look like:
gather time: 0.796875 seconds
write time: 0.78125 seconds
filter time: 0.15625 seconds
otherthread time: 1.156250 seconds
If logging on same thread, the output for "profile.txt" could look like:
gather time: 5.562500 seconds
write time: 5.265625 seconds
filter time: 0.31250 seconds
otherthread time: 0.0 seconds
Copyright John Torjo © 2007
Have a question/ suggestion/ comment? Send me feedback