计时器#
介绍#
VEX GO 中的计时器允许您跟踪已用时间并根据时间间隔执行操作。通过多种时间管理方法,您可以在程序中创建精确且定时的操作。
以下是所有方法的列表:
方法——控制并与大脑的计时器互动。
构造函数——创建额外的计时器。
计时器 – 创建一个附加计时器。
重置#
reset
sets the timer to zero.
Usage:
timer.reset()
参数 |
描述 |
---|---|
该方法没有参数。 |
# Example coming soon
时间#
time
returns the current elapsed time of the timer in the specified units — an integer for MSEC
or a float for SECONDS
.
Usage:
timer.time(units)
参数 |
描述 |
---|---|
|
时间单位为毫秒 |
# Example coming soon
事件#
event
calls a function after a specified amount of time.
Usage:
timer.event(callback, delay)
参数 |
描述 |
---|---|
|
当计时器事件发生时执行的函数。 |
|
函数调用前的延迟,以毫秒为单位。 |
# Example coming soon
构造函数#
Timer#
Timer
creates a new timer. A Timer
object will immediately begin counting the moment it is created and will work with all timer
methods.
Usage:
my_timer = Timer()
参数 |
描述 |
---|---|
此构造函数没有参数。 |
# Example coming soon