核心提示:uses DateUtils;function MicrosecondsToTime(const microSeconds : TLargeInteger) : string;CONSTMicroPe...
uses DateUtils;function MicrosecondsToTime(const microSeconds : TLargeInteger) : string;
CONST
MicroPerMilli = 1000;
var
dt : TDateTime;
microSec : TLargeInteger;
begin
dt := microSeconds / MicroPerMilli / MSecsPerSec / SecsPerDay;
microSec := microseconds - MicroPerMilli * MilliSecondOf(dt) ;
if microsec < 0 then
begin
dt := IncMilliSecond(dt,-1) ;
microsec := MicroPerMilli + microsec;
end;
result := Format('%d days, %s %d', [Trunc(dt), FormatDateTime('hh:nn:ss.z', Frac(dt)), microSec]) ;
end;