UNPKG

jsmodbus

Version:

Implementation for the Serial/TCP Modbus protocol.

20 lines (19 loc) 586 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); class UserRequestMetrics { constructor() { this.createdAt = new Date(); this.startedAt = new Date(); this.receivedAt = new Date(); } get transferTime() { return this.receivedAt.getTime() - this.startedAt.getTime(); } get waitTime() { return this.startedAt.getTime() - this.createdAt.getTime(); } toJSON() { return Object.assign({}, this, { transferTime: this.transferTime }); } } exports.UserRequestMetrics = UserRequestMetrics;