world.GetScriptTime

MUSHclient script function (Method)

Returns the amount of time spent in script routines

Prototype

double GetScriptTime();

Data type meanings

Description

Returns the amount of time spent, in seconds compiling and executing scripts. This is a "double" type, which means that it can contain fractions of a second.

The current command (or script) is excluded from the time, as timing is done when the script routine finishes. Thus, if you type one of the examples below, and *then* check it against the figure shown in the MUSHclient scripting configuration page, they will disagree. However, if you check the time *first* and then run the example, then the times should agree to within 0.000001 seconds. The reason for that discrepancy is that the figure shown in the scripting configuration page is rounded to the 6th decimal place (ie. to the nearest microsecond).

VBscript example

world.note world.getscripttime

Jscript example

world.note(world.getscripttime());

PerlScript example

$world->note($world->getscripttime());

Python example

world.note(world.getscripttime)

Lua example

Note(GetScriptTime())

Return value

The number of seconds, as a "double" spent executing scripts. The current script routine will not be counted, as it has not completed execution yet. Scripts which have errors are not counted in the time.

Related topic

Utilities

See also

FunctionDescription
GetConnectDurationReturns the number of seconds this world has been connected.
GetLineCountGets count of lines received
GetReceivedBytesReturns the number of bytes received from the world
GetSentBytesReturns the number of bytes sent to the world