Skip to content

Commit

Permalink
QML: reduce playposition precision from 1/100th to 1/10th seconds
Browse files Browse the repository at this point in the history
This reduces CPU usage by about 10% on my Intel Core i7 8550U.
  • Loading branch information
Be-ing committed Oct 9, 2021
1 parent 1d9c394 commit eb029c5
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions res/qml/Deck.qml
Original file line number Diff line number Diff line change
Expand Up @@ -185,18 +185,15 @@ Item {

let minutes = Math.floor(positionSeconds / 60);
let seconds = positionSeconds - (minutes * 60);
let centiseconds = Math.trunc((seconds - Math.trunc(seconds)) * 100);
const deciseconds = Math.trunc((seconds - Math.trunc(seconds)) * 10);
seconds = Math.trunc(seconds);
if (minutes < 10)
minutes = "0" + minutes;

if (seconds < 10)
seconds = "0" + seconds;

if (centiseconds < 10)
centiseconds = "0" + centiseconds;

return minutes + ':' + seconds + "." + centiseconds;
return minutes + ':' + seconds + "." + deciseconds;
}

Mixxx.ControlProxy {
Expand Down

0 comments on commit eb029c5

Please sign in to comment.