On 2006-05-26 02:55, krbyxtrm wrote:
Ayon kay krbyxtrm:
hello people,
i have implemented my code this way
start = read_timer(); // for profiling
if ( !any_vec.empty() )
{
std::for_each(
any_vec.begin(),
any_vec.end(),
retrieve); // where retrieve is an empty function for now...
}
end = read_timer();
duration = end - start ; // minus counter error
with this code and having empty callback function,
it duration = 1.2e-1 us
BTW, IS FOR VECTOR WITH 1 ELEMENT
It might be of interest to try with more elements, the increase in time
is not necessarily linear with the number of elements. Caches for
example can be a part of it, if you get a cache-miss on the first
element that will take some time, but the next element will be much
faster. To get good measures you should use more elements and run the
test many times and calculate the average.
Erik Wikstr=F6m
--
"I have always wished for my computer to be as easy to use as my
telephone; my wish has come true because I can no longer figure
out how to use my telephone" -- Bjarne Stroustrup
Yes I think you're right. Afterall, the program will be dealing with