mirror of
https://github.com/randyjc/Rahoot.git
synced 2026-03-13 20:15:35 +01:00
Add concurrently
This commit is contained in:
13
socket/utils/convertTimeToPoint.js
Normal file
13
socket/utils/convertTimeToPoint.js
Normal file
@@ -0,0 +1,13 @@
|
||||
const convertTimeToPoint = (startTime, secondes) => {
|
||||
let points = 1000
|
||||
|
||||
const actualTime = Date.now()
|
||||
const tempsPasseEnSecondes = (actualTime - startTime) / 1000
|
||||
|
||||
points -= (1000 / secondes) * tempsPasseEnSecondes
|
||||
points = Math.max(0, points)
|
||||
|
||||
return points
|
||||
}
|
||||
|
||||
export default convertTimeToPoint
|
||||
Reference in New Issue
Block a user