Use Windows.pkg External_Function QueryPerformanceCounter "QueryPerformanceCounter" kernel32.dll Pointer pPerfCount Returns Boolean External_Function QueryPerformanceFrequency "QueryPerformanceFrequency" kernel32.dll Pointer pPerfFreq Returns Boolean #Replace MAX_COUNT 2000 Function CurentPerformanceCounter Global Returns BigInt Boolean bOk BigInt iCounter Move 0 to iCounter Move (QueryPerformanceCounter(AddressOf(iCounter))) to bOk Function_Return iCounter End_Function Function PerformanceFrequency Global Returns BigInt Boolean bOk BigInt iFrequency Move 0 to iFrequency Move (QueryPerformanceFrequency(AddressOf(iFrequency))) to bOk Function_Return iFrequency End_Function Function PerformanceCounterDifferenceInSeconds Global BigInt iStart BigInt iEnd Returns Number Number nDiff nFreq Get PerformanceFrequency to nFreq Move (iEnd-iStart) to nDiff Function_Return (nDiff/nFreq) End_Function Object oTest is a cObject Property String[] pTestArray Function GetTestItem Integer indx Returns String String[] myArray Get pTestArray to myArray Function_Return myArray[indx] End_Function Procedure SetTestItem Integer indx String sValue String[] myArray Get pTestArray to myArray Move sValue to myArray[indx] Set pTestArray to myArray End_Procedure Procedure PrepareTest //Clear the array property Set pTestArray to (ResizeArray(pTestArray(Self),0)) End_Procedure Function TestOldSchool Returns Number Integer i BigInt iStart iEnd Send PrepareTest Get CurentPerformanceCounter to iStart For i from 0 to MAX_COUNT Send SetTestItem i "string test" Loop Get CurentPerformanceCounter to iEnd Function_Return (PerformanceCounterDifferenceInSeconds(iStart,iEnd)) End_Function Function TestNewWay Returns Number Integer i BigInt iStart iEnd String[] testArray Send PrepareTest Get CurentPerformanceCounter to iStart Get pTestArray to testArray For i from 0 to MAX_COUNT Move "string test" to testArray[i] Loop Set pTestArray to testArray Get CurentPerformanceCounter to iEnd Function_Return (PerformanceCounterDifferenceInSeconds(iStart,iEnd)) End_Function End_Object Procedure TestIt Number nValue Showln "Testing with " MAX_COUNT " elements" Get TestOldSchool of oTest to nValue Showln "Old school: " nValue " seconds" Get TestNewWay of oTest to nValue Showln "New way: " nValue " seconds" End_Procedure Send TestIt Send TestIt Send TestIt inkey windowindex