|
Boost : |
From: John Torjo (john.lists_at_[hidden])
Date: 2005-11-16 10:25:35
>
> After printing 20,000 numbers to the console it should have output like:
> release
> |Tk:|1282| Th:|155| NS/call:|15625| cout|
> |Tk:|1281| Th:|343| NS/call:|34375| enabled log|
> |Tk:|0| Th:|0| NS/call:|0| cout disabled|
> |Tk:|16| Th:|15| NS/call:|15| disabled log|
>
> Basically works like this:
>
> string l_sDC;
> disable_logs("lgTest");
>
> START_MEASUREQ(1000000, "disabled log", &l_sDL)
>
> BOOST_SCOPEDLOG(l_lgTest) << l_ui << endl;
>
> STOP_MEASURE()
>
> BOOST_SCOPEDLOG(l_lg)
> << l_sDL << endl;
>
>
> There's a supporting cMeasureTime class that records time.
> Macros basically start and stop a for loop, then record the results to a
> string (or log if you pass in a logger).
>
Thanks, Andrew -- I'll use your test as well -- especially the
cMeasureTime class ;)
Best,
John
-- John Torjo, Contributing editor, C/C++ Users Journal -- "Win32 GUI Generics" -- generics & GUI do mix, after all -- http://www.torjo.com/win32gui/surfaces.html - Sky's the limit! -- http://www.torjo.com/cb/ - Click, Build, Run!
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk