Gitly
English
Русский
Español
日本語
中文
Português
Pricing
Log in
Register
vxx2
/
vlib
/
v2_toberemoved
/
tests
/
module_storage_example
/
state
/
state.vv2
18
lines
·
14
sloc
·
259 bytes
·
c0624b274a458fe3e487d89ae9554c2e8c25bdb6
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