Tuesday, June 29, 2010

Display a millisecond timespan in Dynamics AX

Simple little job to get the juices flowing. It was nigh-on impossible to track down some code to do this natively within AX, they seem to have removed all decent tracing into some external tool. Not conducive to job-based hacking ;-)

static void Nathan_timeSpan(Args _args)
{
CustTable ct;
System.DateTime first, second;
System.TimeSpan ts;
;

first = System.DateTime::get_Now();
sleep(123);
second = System.DateTime::get_Now();

ts = second.Subtract(first);

info(ts.ToString());
}