Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

calculate fps html canvas

/**
 * @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
}
 
PREVIOUS NEXT
Tagged: #calculate #fps #html #canvas
ADD COMMENT
Topic
Name
9+1 =