I am hijack the topick. Currently to get a current time I am using
var D;
D = new Date() ;
I suspect it reallocates the var's memory each time for the new object and can cause memory fragmentation.
Is there a more efficient way to get current time into same variable instance?
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
I am hijack the topick. Currently to get a current time I am using
var D;
D = new Date() ;
I suspect it reallocates the var's memory each time for the new object and can cause memory fragmentation.
Is there a more efficient way to get current time into same variable instance?