mirror of
https://github.com/Yonokid/PyTaiko.git
synced 2026-02-04 03:30:13 +01:00
cache note arc points, untruncate time
This commit is contained in:
@@ -3,17 +3,8 @@ from typing import Any, Optional
|
||||
|
||||
from libs.global_data import global_data
|
||||
|
||||
|
||||
def rounded(num: float) -> int:
|
||||
sign = 1 if (num >= 0) else -1
|
||||
num = abs(num)
|
||||
result = int(num)
|
||||
if (num - result >= 0.5):
|
||||
result += 1
|
||||
return sign * result
|
||||
|
||||
def get_current_ms() -> int:
|
||||
return rounded(time.time() * 1000)
|
||||
def get_current_ms() -> float:
|
||||
return time.time() * 1000
|
||||
|
||||
|
||||
class BaseAnimation():
|
||||
|
||||
@@ -40,9 +40,9 @@ def rounded(num: float) -> int:
|
||||
result += 1
|
||||
return sign * result
|
||||
|
||||
def get_current_ms() -> int:
|
||||
def get_current_ms() -> float:
|
||||
"""Get the current time in milliseconds"""
|
||||
return rounded(time.time() * 1000)
|
||||
return time.time() * 1000
|
||||
|
||||
def strip_comments(code: str) -> str:
|
||||
"""Strip comments from a string of code"""
|
||||
|
||||
Reference in New Issue
Block a user