Use more compatible time counting format (#10)

This commit is contained in:
Rafał Mikrut 2020-12-13 21:08:29 +01:00 committed by GitHub
parent 97f579aa23
commit b8b70fbe82
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 44 deletions

View File

@ -8,7 +8,7 @@ var last_time : int
const PRINT_TIME_EVERY_MILISECONDS : int = 5000
var time_to_print_next_time : int = PRINT_TIME_EVERY_MILISECONDS
var time_to_show: int = 30 * 1000 # How long test works in miliseconds
var time_to_show: int = 15 * 1000 # How long test works in miliseconds
var time_for_each_step : int = -1
@ -32,7 +32,7 @@ const all_in_one : Array = [
]
func _init():
start_time = OS.get_system_time_msecs()
start_time = OS.get_ticks_msec()
# In case when user doesn't provide time
time_for_each_step = time_to_show / (alone_steps.size() + 1)
@ -47,7 +47,7 @@ func _init():
func _process(delta: float) -> void:
var current_run_time : int = OS.get_system_time_msecs() - start_time
var current_run_time : int = OS.get_ticks_msec() - start_time
if current_run_time > time_to_print_next_time:
print("Test is running now " + str(int(time_to_print_next_time / 1000)) + " seconds")

View File

@ -15,8 +15,8 @@ func _ready():
func _process(_delta):
if time_to_switch - OS.get_system_time_msecs() <= 0:
time_to_switch = Autoload.time_for_each_step + OS.get_system_time_msecs()
if time_to_switch - OS.get_ticks_msec() <= 0:
time_to_switch = Autoload.time_for_each_step + OS.get_ticks_msec()
if current_scene < Autoload.alone_steps.size() - 1:
current_scene += 1

View File

@ -12,49 +12,14 @@ __meta__ = {
}
[node name="Label" parent="." instance=ExtResource( 2 )]
margin_top = 142.0
margin_right = 280.0
margin_bottom = 156.0
[node name="Label2" parent="." instance=ExtResource( 2 )]
margin_left = 284.0
margin_top = 142.0
margin_right = 367.0
margin_bottom = 156.0
[node name="Label3" parent="." instance=ExtResource( 2 )]
margin_left = 371.0
margin_top = 142.0
margin_right = 454.0
margin_bottom = 156.0
margin_top = 293.0
margin_bottom = 307.0
[node name="RichTextLabel" parent="." instance=ExtResource( 1 )]
anchor_right = 0.0
anchor_bottom = 0.0
margin_left = 458.0
margin_right = 738.0
margin_bottom = 298.0
bbcode_text = "Roman
"
text = "Roman
"
[node name="RichTextLabel2" parent="." instance=ExtResource( 1 )]
anchor_right = 0.0
anchor_bottom = 0.0
margin_left = 742.0
margin_right = 1022.0
margin_bottom = 298.0
bbcode_text = "Roman
"
text = "Roman
"
[node name="RichTextLabel3" parent="." instance=ExtResource( 1 )]
anchor_right = 0.0
anchor_bottom = 0.0
margin_top = 302.0
margin_right = 280.0
margin_left = 87.0
margin_right = 321.0
margin_bottom = 600.0
bbcode_text = "Roman
"