ocrobot:kit:arduino_star_kit:tutorial021
差别
这里会显示出您选择的修订版和当前版本之间的差别。
两侧同时换到之前的修订记录前一修订版 | |||
ocrobot:kit:arduino_star_kit:tutorial021 [2017/10/04 08:02] – 弘毅 | ocrobot:kit:arduino_star_kit:tutorial021 [2023/06/07 04:23] (当前版本) – 外部编辑 127.0.0.1 | ||
---|---|---|---|
行 1: | 行 1: | ||
+ | ======显示程序运行了多久====== | ||
+ | <WRAP left round info 70%> | ||
+ | 这个例程展示了如何显示程序运行了多久 | ||
+ | </ | ||
+ | =====代码===== | ||
+ | <code cpp> | ||
+ | unsigned long time; | ||
+ | void setup(){ | ||
+ | | ||
+ | } | ||
+ | void loop(){ | ||
+ | Serial.print(" | ||
+ | time = millis(); | ||
+ | // | ||
+ | Serial.println(time); | ||
+ | // | ||
+ | | ||
+ | } | ||
+ | |||
+ | </ | ||
+ | =====效果参考===== | ||
+ | {{: | ||
+ | <WRAP center round info 100%> | ||
+ | millis() | ||
+ | 描述 | ||
+ | | ||
+ | 参数 | ||
+ | 无 | ||
+ | 返回 | ||
+ | | ||
+ | 提示 | ||
+ | | ||
+ | | ||
+ | </ | ||
+ | |||
+ | =====代码===== | ||
+ | <code cpp> | ||
+ | unsigned long time; | ||
+ | void setup(){ | ||
+ | Serial.begin(9600); | ||
+ | } | ||
+ | void loop(){ | ||
+ | Serial.print(" | ||
+ | time = micros();// | ||
+ | Serial.println(time);// | ||
+ | | ||
+ | } | ||
+ | |||
+ | </ | ||
+ | =====效果参考===== | ||
+ | {{: | ||
+ | <WRAP center round tip 100%> | ||
+ | micros() | ||
+ | 描述 | ||
+ | | ||
+ | 注意:每毫秒是1, | ||
+ | 参数 | ||
+ | 无 | ||
+ | 返回 | ||
+ | | ||
+ | </ | ||
+ | |||
+ | [[ocrobot: |