D365FO – AX – Count elapsed time with a Timer

This is a simple job to count elapsed time

static void timeConsumedFcn(Args _args)
{
   FromTime    startTime;
   int seconds = 5;
   int     i;
   str   elapsed;
   startTime = timeNow();
   i = sleep(seconds*1000);  
   elapsed = timeConsumed(startTime, timeNow());
   info(strFmt("Time elapsed: %1", elapsed));
}

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s