Gitly
English
Русский
Español
日本語
中文
Português
Log in
Register
v
/
vlib
/
v2
/
tests
/
module_storage_example
/
state
/
state.vv2
18
lines
·
14
sloc
·
259 bytes
·
ed1549f6808d68defe18fc93b8940ef1e8aaf004
Raw
1
module state
2
3
__global mut private_ticks = 0
4
pub __global mut total_ticks = 0
5
6
fn bump_private() {
7
private_ticks += 1
8
}
9
10
pub fn tick() int {
11
bump_private()
12
total_ticks += 1
13
return private_ticks
14
}
15
16
pub fn private_tick_count() int {
17
return private_ticks
18
}
19