mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
making time-methods public, fixing gamme of life example
This commit is contained in:
committed by
Alexander Medvednikov
parent
3e8d902a13
commit
4cf68ca7fe
@@ -5,15 +5,15 @@
|
|||||||
module time
|
module time
|
||||||
|
|
||||||
// in ms
|
// in ms
|
||||||
fn ticks() f64 {
|
pub fn ticks() f64 {
|
||||||
return f64(0)
|
return f64(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn sleep(seconds int) {
|
pub fn sleep(seconds int) {
|
||||||
C.sleep(seconds)
|
C.sleep(seconds)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn sleep_ms(seconds int) {
|
pub fn sleep_ms(seconds int) {
|
||||||
C.usleep(seconds * 1000)
|
C.usleep(seconds * 1000)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ module time
|
|||||||
//#include <mach/mach_time.h>
|
//#include <mach/mach_time.h>
|
||||||
|
|
||||||
// in ms
|
// in ms
|
||||||
fn ticks() f64 {
|
pub fn ticks() f64 {
|
||||||
panic('not implemented')
|
panic('not implemented')
|
||||||
/*
|
/*
|
||||||
t := i64(C.mach_absolute_time())
|
t := i64(C.mach_absolute_time())
|
||||||
@@ -19,15 +19,15 @@ fn ticks() f64 {
|
|||||||
return f64(0)
|
return f64(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn sleep(seconds int) {
|
pub fn sleep(seconds int) {
|
||||||
C.sleep(seconds)
|
C.sleep(seconds)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn usleep(seconds int) {
|
pub fn usleep(seconds int) {
|
||||||
C.usleep(seconds)
|
C.usleep(seconds)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn sleep_ms(seconds int) {
|
pub fn sleep_ms(seconds int) {
|
||||||
C.usleep(seconds * 1000)
|
C.usleep(seconds * 1000)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user