It is doable.
assume you have two parameters, p1(for B) and p2(for G)
and then create a calculation field as
Avg(if [ID] = [p1] then [time value] end) - Avg(if [ID] = [p2] then [time value] end)
drag the calculation to the view
It will be easier to show if you can provide a sample workbook
Hope this helps.
Thanks Zhouyi, this seems to work.