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; } }