1
0

Implement MILLISEC system variable

This commit is contained in:
otya128
2016-12-16 23:14:35 +09:00
parent e106374bb6
commit b4d283daad
2 changed files with 10 additions and 0 deletions

View File

@@ -228,6 +228,7 @@ class Compiler
addSystemVariable("TABSTEP", new TabStep());
addSystemVariable("RESULT", new Result());
addSystemVariable("HARDWARE", new Hardware());
addSystemVariable("MILLISEC", new MilliSecond());
}
void addSystemVariable(wstring name, SystemVariable var)
{

View File

@@ -124,3 +124,12 @@ class Hardware : SystemVariable
return Value(cast(int)vm.petitcomputer.hardware);
}
}
class MilliSecond : SystemVariable
{
@property
override Value value()
{
import derelict.sdl2.sdl;
return Value(cast(int)SDL_GetTicks());
}
}