Quantcast
Channel: Microsoft Dynamics 365 Community
Viewing all articles
Browse latest Browse all 64797

Calculate timing in X++ operations [WinAPI::getTickCount()]

$
0
0
While reading some lengthy operations e.g. reading data from CSV files, fetching data in query and uploading data etc I wanted to know the time consuming in each opertion. This helped me to optimize my logic or query in making client-server calls.
We can use following function to know about time consumption;

int                 startTime, endTime;

startTime = WinAPI::getTickCount();
[Perform X++ operations]
endTime = WinAPI::getTickCount();

info(strFmt('It took %1 minutes', ((endTime - startTime)/1000)/60));

Note: WinAPI::getTickCount() tells time in milliseconds you need to change accordingly as per your required unit.

Viewing all articles
Browse latest Browse all 64797

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>