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

all: coroutines (part 2)

This commit is contained in:
Alexander Medvednikov
2023-05-28 05:30:23 +02:00
parent 2162230086
commit 9db10c8f61
6 changed files with 99 additions and 48 deletions

View File

@ -11,7 +11,7 @@ import time
#include "photonwrapper.h"
fn C.photon_init_default() int
fn C.photon_thread_create11(f voidptr)
fn C.photon_thread_create(f voidptr)
fn C.photon_sleep_s(n int)
fn C.photon_sleep_ms(n int)
@ -19,3 +19,8 @@ fn C.photon_sleep_ms(n int)
pub fn sleep(duration time.Duration) {
C.photon_sleep_ms(duration.milliseconds())
}
// init needs to be run
pub fn initialize() int {
return C.photon_init_default()
}