You are reading a single comment by @graf and its replies. Click here to read the full conversation.
  • One more question because this is driving me nuts and I can't find the reason why ledTimer gets incremented at all.

    What happens when I clearTimeout(ledTimer) ? Is it set to an empty function so that when it comes to the given time it does nothing, or is it really removed?

    Also when I add console.log(process.memory()); at the beginning of watch function then it shows memory usage goes up quite a lot when I press the button before the timeout passed.

    The output now looks like that:

    {"free":1722,"usage":78,"total":1800,"history":44,"stackEndAddress":536909512,"flash_start":134217728,"flash_binary_end":134432224,"flash_code_start":134443008,"flash_length":262144}
    before: null
    after: 2
    {"free":1695,"usage":105,"total":1800,"history":44,"stackEndAddress":536909512,"flash_start":134217728,"flash_binary_end":134432224,"flash_code_start":134443008,"flash_length":262144}
    before: null
    after: 4
    {"free":1695,"usage":105,"total":1800,"history":44,"stackEndAddress":536909512,"flash_start":134217728,"flash_binary_end":134432224,"flash_code_start":134443008,"flash_length":262144}
    before: null
    after: 6
    > 
    
About

Avatar for graf @graf started