+#include <QStringList>
+
+#ifdef WIN32
+ #include <windows.h>
+#endif
+
+#ifdef WIN32
+/**
+ Convert the given time structure to milliseconds number
+ @param theTime the time structure to convert
+ @return the calculated number of milliseconds
+*/
+INT64 GetMilliseconds( const FILETIME& theTime )
+{
+ SYSTEMTIME aTime;
+ FileTimeToSystemTime( &theTime, &aTime );
+ INT64 aRes = 0;
+ aRes += aTime.wHour * ( 3600 * 1000 );
+ aRes += aTime.wMinute * ( 60 * 1000 );
+ aRes += aTime.wSecond * ( 1000 );
+ aRes += aTime.wMilliseconds;
+ return aRes;
+}
+#endif
+
+/**
+ Calculate the complete execution time for the current thread
+ @return the calculated time as the number of milliseconds
+*/
+INT64 GetTimeForCurrentThreadInMs()
+{
+#ifdef WIN32
+ FILETIME aCreationTime, anExitTime, aKernelTime, aUserTime;
+ GetThreadTimes( GetCurrentThread(), &aCreationTime, &anExitTime, &aKernelTime, &aUserTime );
+ INT64 aKernelMs = GetMilliseconds( aKernelTime );
+ INT64 aUserMs = GetMilliseconds( aUserTime );
+ return aKernelMs + aUserMs;
+#else
+ struct timespec aTime;
+ clock_gettime( CLOCK_MONOTONIC, &aTime );
+ INT64 aSec = aTime.tv_sec;
+ aSec *= 1000;
+ aSec += aTime.tv_nsec / 1000000;
+ return aSec;
+#endif
+}