Skip to content

Store the millis() value in a unsigned long. #1

@Koepel

Description

@Koepel

The millis() does a rollover from 0xFFFFFFFF to 0x00000000 after about 50 days. To avoid problems, store a millis value always as unsigned long and subtract it with "currentMillis - previousMillis". That substraction with both being unsigned long will result in a valid number, even if millis() is in the middle of a rollover.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions