From 9e1c90880d6ad999424976ff9a8d79dd59670c38 Mon Sep 17 00:00:00 2001 From: pavelyakov Date: Fri, 29 May 2020 13:36:50 +0000 Subject: [PATCH] Add description. git-svn-id: svn://kolibrios.org@8000 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/cmm/lib/timers.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/programs/cmm/lib/timers.c b/programs/cmm/lib/timers.c index 9baaf56623..6b251f612b 100644 --- a/programs/cmm/lib/timers.c +++ b/programs/cmm/lib/timers.c @@ -1,5 +1,12 @@ /* 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 defaultMaxTimers 1000 :struct Timers @@ -8,8 +15,8 @@ dword alloc; dword count; dword size; - void watch(void); - void getTime(); + void revise(void); + void getTime(void); dword set(dword,dword,byte); dword clear(dword); }; @@ -20,7 +27,7 @@ void Timers::getTime(void) $int 0x40 time = EAX; } -void Timers::watch(void) +void Timers::revise(void) { dword position = 0; dword i = 0; @@ -74,7 +81,7 @@ dword Timers::set(dword function, newTime, byte repeat) } dword Timers::clear(dword id) { - IF (!alloc) || (!DSDWORD[id]) RETURN 0; + IF (!alloc) || (!id) || (!DSDWORD[id]) RETURN 0; count--; DSDWORD[id] = 0; RETURN id;