mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
Rewrite time module
This commit is contained in:
committed by
Alexander Medvednikov
parent
223c35ffb9
commit
2ee6ca1b8b
@@ -73,7 +73,7 @@ fn main() {
|
||||
}
|
||||
field = new_field
|
||||
print_field(field)
|
||||
time.sleep_ms(100)
|
||||
time.sleep(time.milliseconds(100))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -53,6 +53,6 @@ fn main() {
|
||||
go fetcher.fetch()
|
||||
}
|
||||
println(fetcher.ids)
|
||||
time.sleep(5)
|
||||
time.sleep(time.seconds(5))
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ const (
|
||||
TetroSize = 4
|
||||
WinWidth = BlockSize * FieldWidth
|
||||
WinHeight = BlockSize * FieldHeight
|
||||
TimerPeriod = 250 // ms
|
||||
TimerPeriod = time.milliseconds(250) // 250ms
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -168,7 +168,7 @@ fn (g mut Game) run() {
|
||||
g.move_tetro()
|
||||
g.delete_completed_lines()
|
||||
glfw.post_empty_event() // force window redraw
|
||||
time.sleep_ms(TimerPeriod)
|
||||
time.sleep(TimerPeriod)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user