Posts

Showing posts with the label getPropertyDescriptor

JavaScript recent Bits and Bobs

Quick post about few things landed, or not yet, in JavaScript world. preciseTime() In this era loads of +new Date , JSC offers since quite a while a handy global function called preciseTime() . Since this function offers more accuracy than milliseconds, and I am talking about microseconds, which is 1/1000 of a millisecond, it's the best option we have to measure benchmarks or be sure that some time elapsed between two statements in a synchronous code flow. You might don't know that a loop between new Date and another new Date could produce completely unexpected results such a negative integer which is kinda unexpected since zero is the best case we would consider. This behavior is behind ticks and clocks , more or less same reason setTimeout or setInterval have never been accurate in therms of delay. preciseTime , this is the obvious name of my latest git repository, could be shimmed or polyfilled quite easily via a node module I can't npm install for some reason,...