1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

parser: check (mut f Foo) syntax

This commit is contained in:
yuyi
2020-05-17 19:51:18 +08:00
committed by GitHub
parent b138cadbcb
commit 7f4cf08516
87 changed files with 492 additions and 480 deletions

View File

@@ -16,7 +16,7 @@ pub fn new_stopwatch() StopWatch {
}
// start Starts the timer. If the timer was paused, restarts counting.
pub fn (t mut StopWatch) start() {
pub fn (mut t StopWatch) start() {
if t.pause_time == 0 {
t.start = time.sys_mono_now()
} else {
@@ -26,18 +26,18 @@ pub fn (t mut StopWatch) start() {
t.pause_time = 0
}
pub fn (t mut StopWatch) restart() {
pub fn (mut t StopWatch) restart() {
t.end = 0
t.pause_time = 0
t.start = time.sys_mono_now()
}
pub fn (t mut StopWatch) stop() {
pub fn (mut t StopWatch) stop() {
t.end = time.sys_mono_now()
t.pause_time = 0
}
pub fn (t mut StopWatch) pause() {
pub fn (mut t StopWatch) pause() {
t.pause_time = time.sys_mono_now()
t.end = t.pause_time // so elapsed keeps track of actual running time
}
@@ -50,4 +50,3 @@ pub fn (t StopWatch) elapsed() Duration {
return Duration(t.end - t.start)
}
}