Closed kashyap1113 closed 10 months ago
@kashyap1113 setInterval() function works well and it call callback function every 500ms. But resolution of the Date().getTime() is 1s because this function use RTC clock. Now default of the PICO board use 1ms RTC timer. You can see the same value twice because function is called twice in a second but Date().getTime() return the same time.
please use millis() function to get milliseconds timestamp instead of new Date().getTime().
I have set an interval to console log every 500 milliseconds. It is even printed every 500 milliseconds. But the value of milliseconds in date object is not updated after 500 milliseconds. It updates only every second.
Code
Output