DEV Community

Discussion on: Build a Timer with React Hooks

Collapse
 
rad_val_ profile image
Valentin Radu

To be superfluous and point out that performance doesn't matter unless it matters (aka don't optimize before you measure and decide it's a problem based on specs and common sense), in a real world app I'd group seconds and minutes like you did, but keep the counter out and suffer the little performance penalty each second while making everything more readable and naturally fitting the model most of us have in mind when we think about time (seconds, minutes).

Collapse
 
emmaadesile profile image
Adesile Emmanuel

Yeah. I tried to avoid making hasty performance optimizations but that's definitely something to consider in a real-world app.