Skip to content

Invalid multiplier for microseconds #2

@rinkishimo

Description

@rinkishimo

hi vinicius,
i usually don't use such a small units, but imho there should be multiplier 1000 if you wanna change microseconds to nanoseconds.

usage delayMicroseconds(4500); // wait min 4.1ms
while delayMicroseconds(int value) means Thread.sleep(0, value*100);
gives me sleep for 450,000 nanoseconds which is 450 microseconds which is only 0.45 miliseconds...

correct sleep should be something like
Thread.sleep(value / 1000, (value % 1000) * 1000);

anyway, maybe it's not big deal as it works for me with 100 on rpi 3 just fine. or i'm just missing something ;)

miro (rinkishimo)

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