Skip to content

Commit

Permalink
Start time update
Browse files Browse the repository at this point in the history
  • Loading branch information
mariusz-reichert authored and shesek committed Mar 19, 2024
1 parent affc4de commit 72d88dd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/electrum/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,7 @@ impl Connection {
let empty_params = json!([]);
loop {
let msg = self.chan.receiver().recv().chain_err(|| "channel closed")?;
let start_time = Instant::now();
trace!("RPC {:?}", msg);
match msg {
Message::Request(line) => {
Expand Down Expand Up @@ -555,7 +556,6 @@ impl Connection {
})
);

let start_time = Instant::now();
let reply = self.handle_command(method, params, id)?;

conditionally_log_rpc_event!(
Expand All @@ -564,7 +564,7 @@ impl Connection {
"event": "rpc response",
"method": method,
"payload_size": reply.to_string().as_bytes().len(),
"duration_µs": start_time.elapsed().as_micros(),
"duration_micros": start_time.elapsed().as_micros(),
"id": id,
})
);
Expand Down

0 comments on commit 72d88dd

Please sign in to comment.