aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorunknown <zachary.romick@vanderbilt.edu> 2020-07-21 23:09:54 -0500
committerunknown <zachary.romick@vanderbilt.edu> 2020-07-21 23:09:54 -0500
commit6c7a2fb8760dd98fc574047d980e6a58327767f3 (patch)
treec84ebafbc61d8de3f294116555f7e87208a94526
parent07d34139ca94bbd281de235a65d0c12a346ed6ec (diff)
Removed redundant code for calculating final time
-rw-r--r--main.js43
1 files changed, 17 insertions, 26 deletions
diff --git a/main.js b/main.js
index f84be0b..12b6140 100644
--- a/main.js
+++ b/main.js
@@ -17,32 +17,23 @@ function compute() {
// Calculate framerate
let frames = (endFrame - startFrame) * frameRate;
- if (frames >= frameRate) {
- seconds = Math.floor(frames / frameRate);
- frames = frames % frameRate;
- milliseconds = Math.round(frames / frameRate * 1000);
- if (milliseconds < 10) {
- milliseconds = '00' + milliseconds;
- } else if (milliseconds < 100) {
- milliseconds = '0' + milliseconds;
- }
- if (seconds >= 60) {
- minutes = Math.floor(seconds / 60);
- seconds = seconds % 60;
- seconds = seconds < 10 ? '0' + seconds : seconds;
- }
- if (minutes >= 60) {
- hours = Math.floor(minutes / 60);
- minutes = minutes % 60;
- minutes = minutes < 10 ? '0' + minutes : minutes;
- }
- } else {
- milliseconds = Math.round(frames / frameRate * 1000);
- if (milliseconds < 10) {
- milliseconds = '00' + milliseconds;
- } else if (milliseconds < 100) {
- milliseconds = '0' + milliseconds;
- }
+ seconds = Math.floor(frames / frameRate);
+ frames = frames % frameRate;
+ milliseconds = Math.round(frames / frameRate * 1000);
+ if (milliseconds < 10) {
+ milliseconds = '00' + milliseconds;
+ } else if (milliseconds < 100) {
+ milliseconds = '0' + milliseconds;
+ }
+ if (seconds >= 60) {
+ minutes = Math.floor(seconds / 60);
+ seconds = seconds % 60;
+ seconds = seconds < 10 ? '0' + seconds : seconds;
+ }
+ if (minutes >= 60) {
+ hours = Math.floor(minutes / 60);
+ minutes = minutes % 60;
+ minutes = minutes < 10 ? '0' + minutes : minutes;
}
// Show the time and mod message in the DOM