moment() vs now

Benchmark created on


Preparation HTML

<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.30.1/moment.min.js" integrity="sha512-hUhvpC5f8cgc04OZb55j0KNGh4eh7dLxd/dPSJ5VyzqDWxsayYbojWyl5Tkcgrmb/RVKCRJI1jNlRbVP4WWC4w==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>

Test runner

Ready to run.

Testing in
TestOps/sec
moment()
let res;
for (let i = 0; i < 100; i++) {
	res = moment().add("1", "day")
}
ready
now
let res;
let now = moment();
for (let i = 0; i < 100; i++) {
	res = now.add("1", "day")
}
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.