Add description.

git-svn-id: svn://kolibrios.org@8000 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
pavelyakov 2020-05-29 13:36:50 +00:00
parent 9aa605c545
commit 9e1c90880d

View File

@ -1,5 +1,12 @@
/* TIMERS PaulCodeman */ /* TIMERS PaulCodeman */
/**
void Timers::revise(void) -> This function revising all timers.
void Timers::getTime(void) -> This function updating current time for timers.
dword set(dword,dword,byte); -> This function seting timer for function Timers::revise.
dword clear(dword); -> This function clearning anything timer.
---------
The functions setTimeout,setInterval,clearInterval,clearTimeout implementing functional JavaScript.
*/
#define offsetSizeTimers 4*3+1 #define offsetSizeTimers 4*3+1
#define defaultMaxTimers 1000 #define defaultMaxTimers 1000
:struct Timers :struct Timers
@ -8,8 +15,8 @@
dword alloc; dword alloc;
dword count; dword count;
dword size; dword size;
void watch(void); void revise(void);
void getTime(); void getTime(void);
dword set(dword,dword,byte); dword set(dword,dword,byte);
dword clear(dword); dword clear(dword);
}; };
@ -20,7 +27,7 @@ void Timers::getTime(void)
$int 0x40 $int 0x40
time = EAX; time = EAX;
} }
void Timers::watch(void) void Timers::revise(void)
{ {
dword position = 0; dword position = 0;
dword i = 0; dword i = 0;
@ -74,7 +81,7 @@ dword Timers::set(dword function, newTime, byte repeat)
} }
dword Timers::clear(dword id) dword Timers::clear(dword id)
{ {
IF (!alloc) || (!DSDWORD[id]) RETURN 0; IF (!alloc) || (!id) || (!DSDWORD[id]) RETURN 0;
count--; count--;
DSDWORD[id] = 0; DSDWORD[id] = 0;
RETURN id; RETURN id;