Hitung kanvas html fps

/**
 * @function calculateFPS
 * @param {number} lasttime 
 * @param {number} currenttime 
 * @returns {number} the result of the calculation
 */
export function calculateFPS(lasttime: number, currenttime: number) {
    let fps = 1000 / (currenttime - lasttime)
    return fps
}
Himanshu Jangid