Pretty simple...
int ticksBegin;
int ticksEnd;
int totalTicks;
int seconds;
int minutes;
int hours;
// Grab the current 'tick' count in AX
ticksBegin = WinAPIServer::getTickCount();
...
ticksEnd = WinAPIServer::getTickCount();
totalTicks = ticksEnd - ticksBegin;
// Find the seconds
seconds = totalTicks/1000;
info (strFmt("%1 seconds", seconds));
// Find the minutes
minutes = seconds/60;
info (strFmt("%1 minutes", minutes));
// Find the hours
hours = minutes/60;
info (strFmt("%1 hours", hours));
// This will show the time in hh:mm:ss format except there may be only one value (e.g. hh:m:ss)
info (strFmt("%1:%2:%3", hours, minutes mod 60, seconds mod 60));
No comments:
Post a Comment