internal static TimeSpan TicksToTimeSpan(double ticks)
{
// Look up the number of ticks per second in the system's configuration,
// then use that to convert to a TimeSpan
long ticksPerSecond = Interop.Sys.SysConf(Interop.Sys.SysConfName._SC_CLK_TCK);
if (ticksPerSecond <= 0)
{
throw new Win32Exception();
}
return TimeSpan.FromSeconds(ticks / (double)ticksPerSecond);
}