|
Boost : |
From: Russell Hind (rhind_at_[hidden])
Date: 2003-03-24 06:58:49
C++Builder doesn't currently support the microsec_clock of date_time
because of its standard library. Would it be possible to add code to
get the time using Win32 methods as this gives millisecond times?
Something like this in microsec_time_clock.hpp seems to work
static time_type local_time()
{
#ifdef __BORLANDC__
SYSTEMTIME lt;
GetLocalTime(<);
date_type d = date_type(lt.wYear,
lt.wMonth,
lt.wDay);
int adjust = resolution_traits_type::res_adjust() / 1000;
time_duration_type td = time_duration_type(lt.wHour,
lt.wMinute,
lt.wSecond,
lt.wMilliseconds * adjust);
return time_type(d, td);
#else
....
#endif
}
Is this Ok, and would it be of interest to anyone? It could be used for
all Win32 compilers (if the adjust statement is correct) or are there
reasons why platform specific code wouldn't be wanted in the library?
We currently log a lot of error information to text files, but
sub-second times are useful. date_time currently doesn't offer this for
C++Builder, so that is why we would like something like this added.
Cheers
Russell
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk