Overview

System Information

The System.Info unit provides a set of static classes and records to query the execution environment, hardware specifications, and system performance.

ApplicationInfo

Provides details about the running application and its environment.

Member Type Description
Version String Application version string.
ExeName String Full path to the current executable.
UserName String Name of the current user.
RunningAsService Boolean True if the process is running as a Windows service.
IsDebuggerPresent Boolean True if a debugger is attached.
ExeLinkTimeStamp Integer Unix timestamp of the executable link time.
CurrentDirectory String Read/set the current working directory.
EnvironmentVariable[name] String Read/set environment variables.
MemoryCounters() Record Returns a ProcessMemoryCounters record.

ProcessMemoryCounters Record

Field Type Description
WorkingSetSize Integer Memory currently used by the process.
PeakWorkingSetSize Integer Peak memory used by the process.
PagefileUsage Integer Page file space used by the process.
PeakPagefileUsage Integer Peak page file space used by the process.

CPUInfo

Hardware and CPU usage information.

Member Type Description
Name String CPU model name.
Count Integer Number of logical processors.
FrequencyMHz Integer CPU frequency in MHz.
SystemUsage Float Global CPU usage percentage (0..100).
KernelUsage Float Global kernel-mode CPU usage percentage.
ProcessUsage Float CPU usage percentage for the current process.

MemoryStatus

Query system memory usage. Must be instantiated via new MemoryStatus.

Property Type Description
Physical Record Total and available physical RAM (MemoryStatusDetail).
Virtual Record Total and available virtual memory.
PageFile Record Total and available page file space.

MemoryStatusDetail Record

Field Type Description
Total Integer Total capacity in bytes.
Available Integer Available capacity in bytes.

OSVersionInfo

Operating system details.

Member Type Description
Name String OS product name (e.g. "Windows 11 Pro").
Version String OS version string (e.g. "10.0.22631").

HostInfo

Network and host-level information.

Member Type Description
Name String NetBIOS name of the machine.
DNSName String DNS hostname.
DNSDomain String DNS domain name.
DNSFullyQualified String Fully qualified DNS name.
Uptime Float System uptime in days.
SystemTime Float Total user-mode time across all processors.
KernelTime Float Total kernel-mode time across all processors.
DomainControllerInfo() Record Returns a DomainControllerInfo record.

DomainControllerInfo Record

Field Type Description
DCName String Name of the domain controller.
DCAddress String Network address of the domain controller.
DCAddressType Integer Type of the DC address (e.g. IPv4).
GUID String GUID of the domain controller.
Name String Name of the domain.
ForestName String Name of the forest.
DCSiteName String Name of the DC site.
ClientSiteName String Name of the client site.
Flags Integer Status and capability flags.

PerformanceCounter

High-resolution timer for performance profiling.

Member Type Description
Create() Constructor Starts a new counter.
Restart() Procedure Resets the counter to zero and starts it.
Stop() Procedure Stops the counter.
Elapsed() Float Seconds elapsed since start/restart.
Running() Boolean True if the counter is currently running.
Now() Static Float Current raw performance counter value in seconds.
Frequency Constant Frequency of the performance counter (ticks per second).

ThreadInfo

Information about the current execution thread.

Member Type Description
ID Integer Current thread ID.
Priority Integer Thread priority level.
IsDebugging Boolean True if the script is currently being debugged.

Global Functions

Function Result Description
SystemMilliseconds Integer Number of milliseconds since the system started.

Examples

Checking Environment

// NO_RUN
PrintLn('User: ' + ApplicationInfo.UserName);
PrintLn('OS: ' + OSVersionInfo.Name);
PrintLn('CPU: ' + CPUInfo.Name + ' (' + IntToStr(CPUInfo.Count) + ' cores)');

var mem := new MemoryStatus;
PrintLn('Free RAM: ' + IntToStr(mem.Physical.Available div (1024*1024)) + ' MiB');

Performance Profiling

var pc := new PerformanceCounter;
// ... some heavy work ...
pc.Stop;
PrintLn(Format('Work took %.3f ms', [pc.Elapsed * 1000]));
Result
Work took 0.002 ms
On this page