1. Programs should be nice

The settings I would prefer to use below are.

tdelay = 0.1 -- sleep(0.1) My version doesn't support it. :( 
timeout = 1  -- be nice every second.  Bad idea if above not available. 
-- This will work across days. 
-- if time() is extremely smaller than timer then readjust 
atom timer, timeout, tdelay 
tdelay = 1 -- second 
timeout = 5 -- seconds 
timer = time() + timeout 
global procedure benice() 
	atom tfuture 
 
	tfuture = time() + timeout 
	if ((time() > timer) or (timer > future)) then 
		timer = future 
		sleep(tdelay) 
	end if 
end procedure 

Unkmar - Lucius L. Hilley III

new topic     » topic index » view message » categorize

2. Re: Programs should be nice

unkmar said...

The settings I would prefer to use below are.

tdelay = 0.1 -- sleep(0.1) My version doesn't support it. :( 
timeout = 1  -- be nice every second.  Bad idea if above not available. 

TYPO: corrected, future is suppose to be tfuture

-- This will work across days. 
-- if time() is extremely smaller than timer then readjust 
atom timer, timeout, tdelay 
tdelay = 1 -- second 
timeout = 5 -- seconds 
timer = time() + timeout 
global procedure benice() 
	atom tfuture 
 
	tfuture = time() + timeout 
	if ((time() > timer) or (timer > tfuture)) then 
		timer = tfuture 
		sleep(tdelay) 
	end if 
end procedure 

Unkmar - Lucius L. Hilley III

new topic     » goto parent     » topic index » view message » categorize

3. Re: Programs should be nice

in eu4 an include std/socket.e
gives you public function delay(atom millisec)

delay() probably should be moved to os.e or task.e

new topic     » goto parent     » topic index » view message » categorize

4. Re: Programs should be nice

ne1uno said...

in eu4 an include std/socket.e
gives you public function delay(atom millisec)

delay() probably should be moved to os.e or task.e

change that from public to global, and that function (delay() ) will work on eu 2.2 or eu 3.0

sleep(0.1) only works on eu 4.0

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu