# callTiming() function · @imqueue/rpc

Source: https://imqueue.org/api/rpc/latest/rpc.calltiming/
Published: 2026-11-12
Author: @imqueue maintainers (https://github.com/imqueue)
Package: @imqueue/rpc 3.11.0 — generated reference, not hand-written

Splits a call's round trip from the request a client sent and the response it was answered with.

**Signature:**

```typescript
export declare function callTiming(request: Partial<IMQRPCRequest> | undefined, response: Partial<IMQRPCResponse> | undefined, answeredAt?: number): IMQCallTiming | null;
```

## Parameters


| Parameter | Type | Description |
| --- | --- | --- |
| request | Partial<[IMQRPCRequest](https://imqueue.org/api/rpc/latest/rpc.imqrpcrequest/)> \| undefined | the request as the client sent it, carrying `sentAt` |
| response | Partial<[IMQRPCResponse](https://imqueue.org/api/rpc/latest/rpc.imqrpcresponse/)> \| undefined | the response as it arrived, carrying `timing` |
| answeredAt | number | _(Optional)_ when the answer arrived, by the caller's clock |


**Returns:**

[IMQCallTiming](https://imqueue.org/api/rpc/latest/rpc.imqcalltiming/) \| null

the split, or `null` where either side did not record its half

## Remarks

Each figure is a difference of two readings of one clock — `total` the caller's, `handled` and `waited` the service's — so clocks that disagree between hosts move no figure. `transit` is what is left, and is where a busy caller, a busy broker and the size of a message show.

Call it from an `afterCall` hook, which runs as the answer arrives.

