| 12345678910111213141516171819202122232425262728293031323334 |
- import { time } from "console";
-
-
-
- export class Calulator {
-
- // timestamp format input
- CTPS(count: number, start: number, end: number): number {
- // Calculate the time difference in milliseconds
- const timeDifference = (end - start) / 1000;
- // Ensure timeDifference is not zero to avoid division by zero
- if (timeDifference === 0) {
- throw new Error("Time difference cannot be zero.");
- }
- console.log(`time diff = ${timeDifference}`);
- // Calculate CTPS
- const CEPS = count / timeDifference;
- return CEPS;
- }
-
- CQPS(count: number, start: number, end: number): number {
- // Calculate the time difference in milliseconds
- const timeDifference = (end - start) / 1000;
- // Ensure timeDifference is not zero to avoid division by zero
- if (timeDifference === 0) {
- throw new Error("Time difference cannot be zero.");
- }
- console.log(`time diff = ${timeDifference}`);
- // Calculate CEPS
- const CEPS = count / timeDifference;
- return CEPS;
- }
- }
|