I have a dictionary of items with the ID as a key. Those items also have a timespan value. One function needs to do something with the items where timespan > searchTime.

Would sorting the list fist be faster or would the sorting take as long as the foreach function. I wish there was a sorted dictionary that allowed you to sort on a different key. 

Which would be faster?

```
List<StatePath> timeSorted = new List<StatePath>();
timeSorted = itemDict.ToList();
timeSorted.Sort((ts1, ts2) => TimeSpan.Compare(ts1.time, ts2.time));
int i = timeSorted.Count -1;
while((i > 0) && timeSorted[i].time >= searchTime)
{
  //do something
}

```

or 

```
foreach(var curItem in itemDict.Values)
{
  if(curItem.time >= searchTime)
  {
    //do something
  }
}

```