You are reading a single comment by @HughB and its replies. Click here to read the full conversation.
  • x =864*dt.getHours()+14.4*dt.getMinutes()+0.24*dt.getSeconds()+0.00024*dt.getMilliseconds();
    
    let wait = 4167*(1-(x%1));
    
    

    This is getting the fractional part of x. So if x is 456.123
    The statement becomes.

    let wait = 4167*(1 - 0.123);
    

    So its working out a value for the next timer call.

About

Avatar for HughB @HughB started