next up previous contents index
Next: File System Interface Up: Operating System and Input/Output Previous: Current Directory   Contents   Index

Date and Time

(string) DateString()
This function returns a string containing the date and time in the format
Tue Jun 12 23:42:38 PDT 2001

(int) MilliSec()
This returns the elapsed time in milliseconds since midnight January 1, 1970 GMT. This can be used to measure script execution time.

(int) StartTiming(array)
This will initialize the values in the array, which must have size 3 or larger, for later use by the StopTiming function. The return value is always 1.

(int) StopTiming(array)
This will place time differences (in seconds) into the array, since the last call to StartTiming (with the same argument). The array must have size 3 or larger. the components are:

0 Elapsed wall-clock time
1 Elapsed user time
2 Elapsed system time

The user time is the time the cpu spent executing in user mode. The system time is the time spent in the system executing on behalf of the process. This uses the UNIX getrusage or times system calls, which may not be available on all systems. If support is not available, e.g., in Windows, the user and system entries will be zero, but the wall-clock time is valid. This function always returns 1.


next up previous contents index
Next: File System Interface Up: Operating System and Input/Output Previous: Current Directory   Contents   Index
Stephen R. Whiteley 2006-10-23