当前位置: 首页 > article >正文

0032【Edabit ★☆☆☆☆☆】【每秒帧数】Frames Per Second

0032【Edabit ★☆☆☆☆☆】【每秒帧数】Frames Per Second

algorithms language_fundamentals math numbers

Instructions

Create a function that returns the number of frames shown in a given number of minutes for a certain FPS.

Examples
frames(1, 1) // 60
frames(10, 1) // 600
frames(10, 25) // 15000
Notes
  • FPS stands for “frames per second” and it’s the number of frames a computer screen shows every second.
Solutions
function frames(minutes, fps) {
    return 60 * minutes * fps ; 
}
TestCases
let Test = (function(){
    return {
        assertEquals:function(actual,expected){
            if(actual !== expected){
                let errorMsg = `actual is ${actual},${expected} is expected`;
                throw new Error(errorMsg);
            }
        }
    }
})();

Test.assertEquals(frames(1, 1), 60)
Test.assertEquals(frames(10, 1), 600)
Test.assertEquals(frames(10, 25), 15000)
Test.assertEquals(frames(500, 60), 1800000)
Test.assertEquals(frames(0, 60), 0)
Test.assertEquals(frames(99, 1), 5940)
Test.assertEquals(frames(419, 70), 1759800)
Test.assertEquals(frames(52, 33), 102960)

http://www.kler.cn/a/104311.html

相关文章:

  • 文生视频领域SOTA工作 Show-1:论文和代码解读
  • 【网络协议】聊聊UDP协议
  • ts | js | 爬虫小公举分享
  • 硬件知识积累 PCIE 接口
  • Python中使用cv2.resize()函数批量自定义缩放图像尺寸
  • 【鸿蒙软件开发】自定义弹窗(CustomDialog)
  • STM32F4VGT6-DISCOVERY:uart1驱动
  • 5、计算电机速度【51单片机控制步进电机-TB6600系列】
  • Open3D(C++) 最小二乘拟合平面(直接求解法)
  • 可观察性支柱:探索日志、指标和跟踪
  • MS COCO数据集的评价标准以及不同指标的选择推荐(AP、mAP、MS COCO、AR、@、0.5、0.75、1、目标检测、评价指标)
  • python爬虫-某政府网站反爬小记——请求参数base64加密
  • ES6初步了解生成器
  • PostPreSql 数据库的一些用法
  • Shell笔记
  • Echarts的legend的特殊图例展示
  • 说一说ajax的请求过程?
  • 【tg】4:NetworkManager :p2p、ice、消息收发
  • React中如何提高组件的渲染效率
  • JavaScript对象与原型