public static string ToHumanReadableTimespan(long miliseconds)
{
const int SEC = 1000;
const int MIN = 60*SEC;
const int H = MIN*60;
var timeSpan = TimeSpan.FromMilliseconds(miliseconds);
if (miliseconds < 1000) return string.Format("{0} ms", timeSpan.Milliseconds);
if (miliseconds/SEC < 60) return string.Format("{0} sec", timeSpan.Seconds);
if (miliseconds/MIN < 60) return string.Format("{0}:{1:00} min", timeSpan.Minutes, timeSpan.Seconds);
if (miliseconds/H < 24) return string.Format("{0}:{1:00}:{2:00} hours", timeSpan.Hours, timeSpan.Minutes, timeSpan.Seconds);
return string.Format("{0}:{1:00}:{2:00}:{3:00} days", timeSpan.Days, timeSpan.Hours, timeSpan.Minutes, timeSpan.Seconds);
}