mirror of
https://gitee.com/openharmony/third_party_nghttp2
synced 2024-11-23 16:00:07 +00:00
spdycat: Rewritten time_delta
This commit is contained in:
parent
53b7b0eda9
commit
9378b74fc3
@ -398,15 +398,9 @@ void on_stream_close_callback
|
||||
|
||||
int64_t time_delta(const timeval& a, const timeval& b)
|
||||
{
|
||||
int64_t res;
|
||||
res = a.tv_usec - b.tv_usec;
|
||||
int off = 0;
|
||||
if(res < 0) {
|
||||
res += 1000000;
|
||||
off = -1;
|
||||
}
|
||||
res += (a.tv_sec + off - b.tv_sec)*1000000;
|
||||
return res/1000;
|
||||
int64_t res = (a.tv_sec - b.tv_sec) * 1000;
|
||||
res += (a.tv_usec - b.tv_usec) / 1000;
|
||||
return res;
|
||||
}
|
||||
|
||||
void print_stats(const SpdySession& spdySession)
|
||||
|
Loading…
Reference in New Issue
Block a user