public int Compare (object x, object y)
{
Timer tx = (x as Timer);
if (tx == null)
return -1;
Timer ty = (y as Timer);
if (ty == null)
return 1;
long result = tx.next_run - ty.next_run;
if (result == 0)
return x == y ? 0 : -1;
return result > 0 ? 1 : -1;
}
}