Skip to content

Small fixes in millis() #554

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 20, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 5 additions & 10 deletions Language/Functions/Time/millis.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,15 @@ categories: [ "Functions" ]
subCategories: [ "Time" ]
---





= millis()


// OVERVIEW SECTION STARTS
[#overview]
--

[float]
=== Description
Returns the number of milliseconds since the Arduino board began running the current program. This number will overflow (go back to zero), after approximately 50 days.
Returns the number of milliseconds passed since the Arduino board began running the current program. This number will overflow (go back to zero), after approximately 50 days.
[%hardbreaks]


Expand All @@ -28,11 +23,11 @@ Returns the number of milliseconds since the Arduino board began running the cur

[float]
=== Parameters
Nothing
None

[float]
=== Returns
Number of milliseconds since the program started (unsigned long)
Number of milliseconds passed since the program started (unsigned long)

--
// OVERVIEW SECTION ENDS
Expand All @@ -47,7 +42,7 @@ Number of milliseconds since the program started (unsigned long)
[float]
=== Example Code
// Describe what the example code is all about and add relevant code ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄
The code reads the milllisecond since the Arduino board began.
This example code prints on the serial port the number of milliseconds passed since the Arduino board started running the code itself.

[source,arduino]
----
Expand All @@ -68,7 +63,7 @@ void loop() {

[float]
=== Notes and Warnings
Please note that the return value for millis() is an unsigned long, logic errors may occur if a programmer tries to do arithmetic with smaller data types such as int's. Even signed long may encounter errors as its maximum value is half that of its unsigned counterpart.
Please note that the return value for millis() is of type `unsigned long`, logic errors may occur if a programmer tries to do arithmetic with smaller data types such as `int`. Even signed `long` may encounter errors as its maximum value is half that of its unsigned counterpart.

--
// HOW TO USE SECTION ENDS
Expand Down