Kernel | ||
Class | ||
Member of ScriptUtils Use Kernel object |
Kernel - COM API for calling some of Kernel32 functions. | |||||||
Process - Process object. Timing informations, priority settings and Ids. (CurrentProcess property, Current process.) | |||||||
Thread - Thread object. Timing informations, priority settings and Ids. (PrimaryThread property, Primary thread of the process.) | |||||||
Thread - Thread object. Timing informations, priority settings and Ids. (CurrentThread property, Current thread) | |||||||
Process - Process object. Timing informations, priority settings and Ids. (Process property, The process of the thread.) |
CloseHandle | Closes an open object handle. | |
CopyFile | The CopyFile method copies an existing file to a new file. | |
CreateProcess | Creates a new process and its primary thread. The new process executes the specified executable file. | |
DeleteFile | The DeleteFile method deletes an existing file. | |
MoveFile | The MoveFile method renames/moves an existing file or a directory (including all its children). | |
Sleep | Suspends the execution of the current thread for a specified interval. | |
SwitchToThread | Causes the calling thread to yield execution to another thread that is ready to run on the current processor. The operating system selects the thread to yield to. | |
WaitForSingleObject | returns when one of the following occurs: The specified object is in the signaled state . The time-out interval elapses. |
CurrentDirectory | Retrieves or sets the current directory for the current process. | |
String, RW | ||
CommandLine | The command-line string for the current process. | |
String, RO | ||
ComputerName | Retrieves the computer name of the current systιm. | |
String, RO | ||
CurrentProcess | Current process. | |
Process, RO | ||
CurrentThread | Current thread | |
Thread, RO | ||
EnvironmentStrings | The environment block for the current process. | |
String, RO | ||
EnvironmentVariables | Retrieves the value of the specified variable from the environment block of the calling process. | |
String, RO | ||
hrCounter | Retrieves the current value of the high-resolution performance counter, if one exists. | |
double, RO | ||
hrFrequency | Retrieves the frequency of the high-resolution performance counter, if one exists. | |
double, RO | ||
hrTimeCounter | Retrieves the current value of the high-resolution performance counter, if one exists. The value of counter is converted to time (divided by hrFrequency). | |
double, RO | ||
TempPath | Retrieves the path of the directory designated for temporary files. | |
String, RO | ||
TickCount | The number of milliseconds that have elapsed since Windows was started. | |
Long, RO |
| ||
<% Set Kernel = CreateObject("ScriptUtils.Kernel")'Creates the Kernel object Response.Write "<PRE>" Response.Write "<br>ComputerName :" & Kernel.ComputerName Response.Write "<br>CommandLine :" & Kernel.CommandLine Response.Write "<br>CurrentDirectory :" & Kernel.CurrentDirectory Response.Write "<br>TempPath :" & Kernel.TempPath Response.Write "<br>EnvironmentStrings :" & Kernel.EnvironmentStrings Response.Write "<br>Process.KernelTime :" & Kernel.CurrentProcess.KernelTime Response.Write "<br>Process.UserTime :" & Kernel.CurrentProcess.UserTime Response.Write "<br>Thread.KernelTime :" & Kernel.CurrentThread.KernelTime Response.Write "<br>Thread.UserTime :" & Kernel.CurrentThread.UserTime Dim I For I=1 To 10 Response.Write "<br>TickCount :" & Kernel.TickCount Kernel.Sleep 500 Next Response.Write "</PRE>" %> |
| ||
<Script RunAt=Server Language=VBScript> Set Kernel = CreateObject("ScriptUtils.Kernel")'Creates the Kernel object 'Get start times TickCount = Kernel.TickCount KernelTime = Kernel.CurrentThread.KernelTime UserTime = Kernel.CurrentThread.UserTime ' .. 'Some script commands ' .. For i=1 To 100000 j = i Next 'Write times Response.Write "<br>Script time : " & (Kernel.TickCount - TickCount) & " ms" Response.Write "<br>Kernel time : " & CLng((Kernel.CurrentThread.KernelTime - KernelTime)*86400000) & " ms" Response.Write "<br>UserTime time : " & CLng((Kernel.CurrentThread.UserTime - UserTime)*86400000) & " ms" Kernel = Empty </Script> |