mirror of
https://github.com/nvms/prsm.git
synced 2025-12-15 15:50:53 +00:00
16 lines
238 B
TypeScript
16 lines
238 B
TypeScript
export class Latency {
|
|
start = 0;
|
|
end = 0;
|
|
ms = 0;
|
|
interval: ReturnType<typeof setTimeout>;
|
|
|
|
onRequest() {
|
|
this.start = Date.now();
|
|
}
|
|
|
|
onResponse() {
|
|
this.end = Date.now();
|
|
this.ms = this.end - this.start;
|
|
}
|
|
}
|