Kevin Goodsell <us*********************@neverbox.com> wrote in message news:<cd***************@newsread3.news.pas.earthli nk.net>...
J. Campbell wrote: Thomas Baier <th****@tho-bai.de> wrote in message news:<3f***********************@newsread2.arcor-online.net>...
So how can I get it in milliseconds?
The following will do what you want:
int main(){
int clo = clock();
//do stuff
cout << (clock() - clo) << endl;
return 0;
}
clock() is not a function for retrieving elapsed (real) time, and it's
result is not measured in milliseconds. clock() gives *processor time*,
and the precision it uses depends on the implementation.
-Kevin
Thanks for the heads-up. On my implimentation, clock() returns
milliseconds with circa 15 ms precision, and I'd assumed (always
imprudent) that it worked the same across the board. I dug a little
and learned of the CLOCKS_PER_SEC constant, which will help a bit for
gross measurements. Thanks for keeping me on the
straight-and-narrow...