Ask HN: Can calc() be faster than static %

1 points by batjaa ↗ HN
I just made a little test to compare how slow calc() is comparing to an assigned % width.

But my test would show that calc() is much more faster. I can't believe it and think I made a mistake somewhere.

If you have the time please checkout and point where I made a mistake. If there's no mistake I would say calc() is truly much faster.

git: https://github.com/batjaa/compare-calc

1 comment

[ 2.8 ms ] story [ 14.8 ms ] thread
I'd guess calc is executed after your timer ended and therefore doesn't register in your measurement.