A self join could auto-enter the previous record's time so that you can subtract the two values, but it looks like you need to add a field that distinguishes one session from another to use as a match field in that relationship.
Thanks for your reply. I've gone a bit blank with this one. Your comment re. the session field, if that's in addition to the __pkPHID field where does it sit in the relationship.
Sorry I've spent so long on this today I've gone 'logic blind'.
Take a look at the rows of data boxed in red and compare them to those boxed in blue. There is nothing in your data that makes the one group different from the other. If you added another field that stored a value unique to each such groups of records--some kind of "session ID", you could tell the groups apart and this field could be part of a relationship that self joins only records of the same session.
You could create a record number in a related table once for each such session and use an auto-entered serial or UUID to get such a value.