Skip to content

Commit a71ac02

Browse files
authored
Update millis.adoc (#797)
* Update millis.adoc changed variable named "time" to "my_time", because it was a conflict when compiling on ESP32 board; And it is not a good practice to define such generic variables that could be used in system variables. Using user variables like my_time and my_temp_sensor is much easier to understand for beginners and more intuitive, easier to differentiate from the system variables. * Update millis.adoc
1 parent f4dceaa commit a71ac02

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Language/Functions/Time/millis.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,16 @@ This example code prints on the serial port the number of milliseconds passed si
4747

4848
[source,arduino]
4949
----
50-
unsigned long time;
50+
unsigned long myTime;
5151
5252
void setup() {
5353
Serial.begin(9600);
5454
}
5555
void loop() {
5656
Serial.print("Time: ");
57-
time = millis();
57+
myTime = millis();
5858
59-
Serial.println(time); //prints time since program started
59+
Serial.println(myTime); //prints time since program started
6060
delay(1000); // wait a second so as not to send massive amounts of data
6161
}
6262
----

0 commit comments

Comments
 (0)