mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
parser: deprecate short struct init (#10842)
This commit is contained in:
@ -4,7 +4,7 @@ import time
|
||||
// time than you have specified. To avoid false positives from CI test
|
||||
// failures, some of the asserts will be run only if you pass `-d stopwatch`
|
||||
fn test_stopwatch_works_as_intended() {
|
||||
mut sw := time.new_stopwatch({})
|
||||
mut sw := time.new_stopwatch()
|
||||
// sample code that you want to measure:
|
||||
println('Hello world')
|
||||
time.sleep(1 * time.millisecond)
|
||||
@ -15,7 +15,7 @@ fn test_stopwatch_works_as_intended() {
|
||||
|
||||
fn test_stopwatch_time_between_pause_and_start_should_be_skipped_in_elapsed() {
|
||||
println('Testing pause function')
|
||||
mut sw := time.new_stopwatch({})
|
||||
mut sw := time.new_stopwatch()
|
||||
time.sleep(10 * time.millisecond) // A
|
||||
eprintln('Elapsed after 10ms nap: ${sw.elapsed().milliseconds()}ms')
|
||||
assert sw.elapsed().milliseconds() >= 8 // sometimes it sleeps for 9ms on windows..
|
||||
|
Reference in New Issue
Block a user