html5 / jQuery, Clock that does milliseconds animating every 100ms, <div> or <canvas>? -
i've coded small stopwatch / clock in jquery, run on android , ios using phonegap build, stopwatch shows time since stopwatch started in format of "00:00:00.0", includes milliseconds last block of numbers , gets updated every 100ms. have been looking on google canvas vs div performance articles nothing seems mention how perform updating text @ 100ms intervals.
im wondering if best update text showing time in <div>
or should in <canvas>
? @ moment using div , every , there tiny bit of lag looks browser cant keep up, advice / insight situation appreciated, guys!
i'll transcribe comments here;
you should know canvas re-draws each cycle, whereas dom elements moved/animated when requested. tho think, such simple animation, neither matter, dom movement () faster.
the downside dom-element animation might browser performance visually tho. browsers tend make rotating , transforming dom-elements differently, said; ugly (sharp edges etc.).
the timer won't lag, don't worry. javascript engines these days high-performance. won't hiccups in matter of time, might different dom in different browsers. visual performance meant that, not stuttering :)
also want achieve pretty light. both work. go dom tho, that's personal :)
Comments
Post a Comment