making time-methods public, fixing gamme of life example

pull/667/head
Stephan Bösebeck 2019-06-26 16:10:42 +02:00 committed by Alexander Medvednikov
parent 3e8d902a13
commit 4cf68ca7fe
2 changed files with 7 additions and 7 deletions

View File

@ -5,15 +5,15 @@
module time
// in ms
fn ticks() f64 {
pub fn ticks() f64 {
return f64(0)
}
fn sleep(seconds int) {
pub fn sleep(seconds int) {
C.sleep(seconds)
}
fn sleep_ms(seconds int) {
pub fn sleep_ms(seconds int) {
C.usleep(seconds * 1000)
}

View File

@ -9,7 +9,7 @@ module time
//#include <mach/mach_time.h>
// in ms
fn ticks() f64 {
pub fn ticks() f64 {
panic('not implemented')
/*
t := i64(C.mach_absolute_time())
@ -19,15 +19,15 @@ fn ticks() f64 {
return f64(0)
}
fn sleep(seconds int) {
pub fn sleep(seconds int) {
C.sleep(seconds)
}
fn usleep(seconds int) {
pub fn usleep(seconds int) {
C.usleep(seconds)
}
fn sleep_ms(seconds int) {
pub fn sleep_ms(seconds int) {
C.usleep(seconds * 1000)
}