DoteDote Edison
Thinks Too Much
Join date: 6 Jun 2004
Posts: 790
|
11-01-2004 17:32
I've been thinking of ways to combat laggy scripts. So my question is:
Is there any difference between; (a) calling a timer event every 10-seconds to execute code, and (b) building a loop that executes code, sleeps 10-seconds, then loops back to execute again?
I'm guessing the lag is due to the execution of code every 10-seconds, not a running timer. So, both methods should burn the same amount of sim resource. Am I correct? Or does simply including a timer in a script add overhead that a llSleep loop would not add?
|
Moleculor Satyr
Fireflies!
Join date: 5 Jan 2004
Posts: 2,650
|
11-01-2004 18:37
From: DoteDote Edison I've been thinking of ways to combat laggy scripts. So my question is:
Is there any difference between; (a) calling a timer event every 10-seconds to execute code, and (b) building a loop that executes code, sleeps 10-seconds, then loops back to execute again?
I'm guessing the lag is due to the execution of code every 10-seconds, not a running timer. So, both methods should burn the same amount of sim resource. Am I correct? Yes. A Linden once said as much. I'd link to it, but another Linden deleted that entire forum.
|
Djiket Nyak
Join date: 30 Sep 2004
Posts: 116
|
11-01-2004 18:41
Are scripts client side or server side?
As in the client reads the script, processes it, and sends info back to the server, or is it the otherway around?
_____________________
My SL Blog- Eat a beaver, save a tree.
|
Hank Ramos
Lifetime Scripter
Join date: 15 Nov 2003
Posts: 2,328
|
11-01-2004 18:59
From: Djiket Nyak Are scripts client side or server side?
As in the client reads the script, processes it, and sends info back to the server, or is it the otherway around? Scripts are all server-side. You write them and compile them client-side, then upload them to the server where they run on the individual server computer.
|
Hank Ramos
Lifetime Scripter
Join date: 15 Nov 2003
Posts: 2,328
|
11-01-2004 19:00
From: DoteDote Edison Is there any difference between; (a) calling a timer event every 10-seconds to execute code, and (b) building a loop that executes code, sleeps 10-seconds, then loops back to execute again? From what Lindens have told me directly, there is no difference.
|
DoteDote Edison
Thinks Too Much
Join date: 6 Jun 2004
Posts: 790
|
11-01-2004 19:10
Thanks.
|
Water Rogers
Registered User
Join date: 1 May 2003
Posts: 286
|
11-02-2004 02:34
I prefer using the timer event handler because you have the option of flexibility. Your object can raise other events (like touch, or listen, etc) while a timer has been set in between times it's being excecuted. If you have a sleep in your script, it will actually stop the entire script from excecuting any code until the time has run out for the sleep.
--Water
_____________________
From: Philip Linden For the more technically minded - the problem is actually NOT the asset server (or 'asshat' as you prefer to affectionately call it herein).
|