Commit e3e71973 authored by Steven Allen's avatar Steven Allen

chore: simplify

parent 8f653d3c
......@@ -202,7 +202,7 @@ func runDistribution(b *testing.B, instances []testinstance.Instance, blocks []b
nst := fetcher.Adapter.Stats()
stats := runStats{
Time: time.Now().Sub(start),
Time: time.Since(start),
MsgRecd: nst.MessagesRecvd,
MsgSent: nst.MessagesSent,
Dups: st.DupBlksReceived,
......
......@@ -41,16 +41,12 @@ func (r *receiver) ReceiveError(err error) {
func (r *receiver) PeerConnected(p peer.ID) {
r.peers[p] = struct{}{}
select {
case r.connectionEvent <- struct{}{}:
}
r.connectionEvent <- struct{}{}
}
func (r *receiver) PeerDisconnected(p peer.ID) {
delete(r.peers, p)
select {
case r.connectionEvent <- struct{}{}:
}
r.connectionEvent <- struct{}{}
}
func TestMessageSendAndReceive(t *testing.T) {
// create network
......
......@@ -43,7 +43,7 @@ func (lt *latencyTracker) CheckDuration(key cid.Cid) (time.Duration, bool) {
request, ok := lt.requests[key]
var latency time.Duration
if ok {
latency = time.Now().Sub(request.startedAt)
latency = time.Since(request.startedAt)
}
return latency, ok
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment