TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

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

1 点作者 batjaa将近 10 年前
I just made a little test to compare how slow calc() is comparing to an assigned % width.<p>But my test would show that calc() is much more faster. I can&#x27;t believe it and think I made a mistake somewhere.<p>If you have the time please checkout and point where I made a mistake. If there&#x27;s no mistake I would say calc() is truly much faster.<p>git: https:&#x2F;&#x2F;github.com&#x2F;batjaa&#x2F;compare-calc

1 comment

detaro将近 10 年前
I&#x27;d guess calc is executed after your timer ended and therefore doesn&#x27;t register in your measurement.