ios - 带两位小数的定时定时器
问题描述
是否可以使用带有两位小数的 schedulerTimer
让 timer = Timer.scheduledTimer(timeInterval: 0.10 , target: self, selector: #selector(fireTimer), userInfo: nil, repeats: true)
时间间隔为 0.10
解决方案
确实。
请注意,该方法中的timeInterval
参数scheduedTimer
描述为:
计时器触发之间的秒数。如果
ti
小于或等于 0.0,则此方法选择 0.1 毫秒的非负值。
文档: https ://developer.apple.com/documentation/foundation/timer/1412416-scheduledtimer
推荐阅读
- python - TensorFlow 和 Keras 入门:过去 (TF1) 现在 (TF2)
- c++ - 如何在使用 ItemType 的模板类时将新节点插入二叉树 C++。(我是 C++ 新手)
- vue.js - 如何在 Vue main.js 中导入 jspdf-autotable?
- python - 如何在元组上完成 fit_transform,或者能够通过将元组更改为...来完成数据上的 fit_transform?
- ios - 使用 UICollectionView 创建类似卡片布局的火种
- java - 我正在尝试在 java 中实现凯撒密码,但没有任何想法,因为我必须需要一个 char[] 键作为参数而不是 int 移位
- amazon-web-services - 主动存储和 S3
- c++ - 如何查看有关 async_accept 失败的原始 tcp 数据?
- javascript - 使用 removeChild 后如何解决错误的滚动
- python - 对象在 numpy 中不可调用