as*******@ntust.org (?_???F) wrote in message news:<4D********@ntust.org>...
I can include time.h and use time() to get UTC seconds,but
how can I get microseconds ??
My OS is windows.
The CVS version of boost date_time has a class called microsec_clock
that allows you to write this:
using namespace boost::posix_time;
ptime t = microsec_clock::local_time();
...
On windows this uses the ftime API which will be millisecond
resolution for sure and some hardware might be micro-second. You'll
have to try it to be sure. On Unix this clock uses the GetTimeOfDay
interface which seems to reliably produce microsecond level samples.
If you want this in a released version of Boost you'll probably need
to wait a few weeks until 1.32 is released.
Jeff