Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Is there any way to get script time from a script

MCM Villiers
Registered User
Join date: 7 Oct 2007
Posts: 39
01-16-2008 02:31
Heres the thing, I want to make my script as efficient as possible and I need to know the script time to do this, is there any way just with a script and not having special privs to test this like on a piece of land I have rented?
Squirrel Wood
Nuteater. Beware!
Join date: 14 Jun 2006
Posts: 471
01-16-2008 02:45
Nope.

Though what you can do is set a countdown/timer and measure the time it takes your script to do things.
MCM Villiers
Registered User
Join date: 7 Oct 2007
Posts: 39
01-16-2008 02:55
From: Squirrel Wood
Nope.

Though what you can do is set a countdown/timer and measure the time it takes your script to do things.

how would I do that? I know how to set a timer, but a count down?
Squirrel Wood
Nuteater. Beware!
Join date: 14 Jun 2006
Posts: 471
01-16-2008 03:18
CODE

default {
state_entry()
{
llResetTime();
}
touch_start(integer num_touch)
{
float time = llGetTime(); //Instead getting, and then resetting the time, we could use llGetAndResetTime() to accomplish the same thing.
llResetTime();
llSay(0,(string)time + " seconds have elapsed since the last touch." );
}
}
MCM Villiers
Registered User
Join date: 7 Oct 2007
Posts: 39
01-16-2008 03:48
Thanks! I'll try that!
edit: will this work for a whole script like a temp rez?
falney Finney
Freedom is just a word
Join date: 18 Dec 2006
Posts: 66
01-16-2008 08:23
Uhm... Temp rezzer? If thats what you are doing... I think I have some recollection of the Lidens saying you aren't allowed to use them.

Don't hold me to that.. I cant remember for sure if it was something some one said in passing, something in the ToS or one of my "I'm addicted to SL so I will dream about it" dreams! Or all of the above!

Either way... It will be worth checking up before you spend a long time developing it!... Just incase ^^
_____________________
Self proclaimed Genius

Pessimist is only a name that an optimist calls a realist!

Heterosexuality is just a fancy word for legalized sexism
Meade Paravane
Hedgehog
Join date: 21 Nov 2006
Posts: 4,845
01-16-2008 08:28
You could vote for SVC-835...

/me points at her signature.

edit: er.. might not help since you're renting.. You could still vote for it anyway! :)
_____________________
Tired of shouting clubs and lucky chairs? Vote for llParcelSay!!!
- Go here: http://jira.secondlife.com/browse/SVC-1224
- If you see "if you were logged in.." on the left, click it and log in
- Click the "Vote for it" link on the left
Ceera Murakami
Texture Artist / Builder
Join date: 9 Sep 2005
Posts: 7,750
01-16-2008 08:43
Coordinate with a sim owner or estate manager, and they can check the script time for you.

Be aware that a temp rezzer used to constantly re-rez an object in place, so it seems to always be there, may only take one prim from your parcel's allocation, but it takes TWICE as many prims from the sim's total allocation of prims as the temp-rezzed part takes to build normally, and the temp rezzers also cause noticable client-side lag. I had a Shinto Shrine that was in a temp rezzer. Thought I was doing something really slick by only using one prim to display a 127 prim shrine. But the impact on the sim was that the sim's prim count kept fluctuating by an extra 127 or 254 prims, every time it rezzed a fresh copy before the old one vanished. You don't get something for nothing from a temp-rezzer. You just borrow/steal resources from the rest of the sim.

The only good use for a temp-rezzer is for things that are only there for a brief period of time, like a vendor that displays a 'hologram' of a prim object for a minute when requested; or a rezzer that produces a small number of low-prim objects, like a rock that makes fireflies. NEVER use them for something that is to look like it is there all the time, because doing so is always going to be harmful to the sim.

Any temp rezzer should be counted by you as taking twice as much prim resources as what it rezzes, even if it only is counted as one prim against your parcel limits.
_____________________
Sorry, LL won't let me tell you where I sell my textures and where I offer my services as a sim builder. Ask me in-world.
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
01-16-2008 08:59
If by chance you mean "script time" as in the value you can find in the Statistics window along with other simulater information, I don't think there's any way to retrieve that from a script. You can get time dilation with llGetRegionTimeDilation() though.
Meade Paravane
Hedgehog
Join date: 21 Nov 2006
Posts: 4,845
01-16-2008 09:17
From: Hewee Zetkin
If by chance you mean "script time" as in the value you can find in the Statistics window along with other simulater information, I don't think there's any way to retrieve that from a script. You can get time dilation with llGetRegionTimeDilation() though.

Time dilation is how fast the physics engine is running vs RL.. There's a lot of things aside from scripts that can bring time dilation down.
_____________________
Tired of shouting clubs and lucky chairs? Vote for llParcelSay!!!
- Go here: http://jira.secondlife.com/browse/SVC-1224
- If you see "if you were logged in.." on the left, click it and log in
- Click the "Vote for it" link on the left
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
01-16-2008 09:29
From: Meade Paravane
Time dilation is how fast the physics engine is running vs RL.. There's a lot of things aside from scripts that can bring time dilation down.

Yes, I know. It was just supplemental information. I think that and simulator FPS (the two are directly correlated anyway) are the only pieces of data from the Statistics window you can retrieve directly from a script. You cannot retrieve the sim's overall script time, and you definitely don't have programatic access to how much script time is being used up by your particular script or object (info from the Top Scripts region/estate dialog).
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
01-16-2008 10:57
you can get a relative value for dilation over time by storing unix time at startup and comparing to get time (which is affected by dilation) to give you an average over a longer time (no help for the stat though)
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
Oni Horan
Registered User
Join date: 11 Jan 2008
Posts: 89
01-16-2008 19:10
this would be so important... it would the only way to check if someone entering your place has some truly problematic scripts running.
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
01-16-2008 20:09
Another check I use that is pretty reliable is to find a new, empty island that has scripts enabled. It usually doesn't take too much time to find one.

Hit ctrl/shift/1 to bring up the statistics bar and then click "Simulator" to expand it down and "Time (ms)" to expand that. Look at the "Script Time". A good island will show from 0.2 ms to around 0.5. When you start up your script you will see that number go up.

It isn't nearly as exact as using the Estate Tools but is the best indication we have if you don't have access to them.

I have been caught by the owner one time doing that. I just explained what I was doing and it was no problem. They invited me back whenever I wanted until the island was developed.
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Meade Paravane
Hedgehog
Join date: 21 Nov 2006
Posts: 4,845
01-17-2008 08:12
From: Oni Horan
this would be so important... it would the only way to check if someone entering your place has some truly problematic scripts running.

So vote for SVC-835!!!!
_____________________
Tired of shouting clubs and lucky chairs? Vote for llParcelSay!!!
- Go here: http://jira.secondlife.com/browse/SVC-1224
- If you see "if you were logged in.." on the left, click it and log in
- Click the "Vote for it" link on the left
MCM Villiers
Registered User
Join date: 7 Oct 2007
Posts: 39
01-18-2008 03:53
From: Meade Paravane
So vote for SVC-835!!!!

We all should and I have :)
Meade Paravane
Hedgehog
Join date: 21 Nov 2006
Posts: 4,845
01-18-2008 07:53
Ty! :)
_____________________
Tired of shouting clubs and lucky chairs? Vote for llParcelSay!!!
- Go here: http://jira.secondlife.com/browse/SVC-1224
- If you see "if you were logged in.." on the left, click it and log in
- Click the "Vote for it" link on the left