Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Getting minutes, seconds and centiseconds from milliseconds
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36
Browser:
Chrome 134
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
Math.floor
12146357.0 Ops/sec
using %
1595322.0 Ops/sec
using % v2
1841941.4 Ops/sec
Script Preparation code:
this.ms = Math.floor(Math.random() * 10000000)
Tests:
Math.floor
this.cs = Math.floor(this.ms / 10); this.s = Math.floor(this.cs / 100); this.m = Math.floor(this.s / 60);
using %
this.residue_ms = this.ms % 10; this.residue_cs_in_ms = this.ms % 1000; this.residue_s_in_ms = this.ms % 60000; this.m_in_ms = this.ms - this.residue_s_in_ms; this.s_in_ms = this.residue_s_in_ms - this.residue_cs_in_ms; this.cs_in_ms = this.residue_cs_in_ms - this.residue_ms; this.m = this.m_in_ms / 60000; this.s = this.s_in_ms / 1000; this.cs = this.cs_in_ms / 10;
using % v2
this.residue_ms = this.ms % 10; this.total_cs = (this.ms - this.residue_ms) / 10; this.cs = this.total_cs % 100; this.total_s = (this.total_cs - this.cs) / 100; this.s = this.total_s % 60; this.m = (this.total_s - this.s) / 60;