Nice example. You are got zero because you set zeros:
Code:
    timestamp = 0
    timestamp2 = 0
- these counters never changed.
The condition:
Code:
    if tcp_flags(tcp.flags) == 'S'
not working, because packet with http request could not be with "SYN" flag. TCP session is established (SYN - SYN/ACK - ACK) before http protocol start to send request. You need to formulate the task more carefull. What time delta...