I'll assume we're talking about a web session, so there are no log off times. I'll also assume your logs contain a unique session ID for each user. All you have to do is choose the interval you want (say 10 minutes), and then count the number of unique users accessing the site during the 10 minutes starting at 13:02:56. This is about as close as you can come, given that there are no log offs.
As for how to make the parsing efficient, I suspect it will be fast enough for most situations to just start at the beginning and go forward until you hit that time, but you could also use a binary search algorithm. This is sorted data, so you can take advantage of that.