private string FormatDuration(long duration)
{
// When tracing is reconfigured at runtime we might not
// have the enter time at hand which results in huge duration times
// We mark them as N.a. to indicate that we have the enter time not recorded
if (duration > 0xfffffffffL)
{
return "N.a.ms";
}
return string.Format("{0:N0}ms", duration / 10000);
}