Click here to Skip to main content
15,885,216 members
Articles / Desktop Programming / WPF

Benchmark start-up and system performance for .Net, Mono, Java, C++ and their respective UI

Rate me:
Please Sign up or sign in to vote.
4.94/5 (44 votes)
2 Sep 2010CPOL19 min read 159.3K   1.3K   67  
What is the start-up and system performance overhead for .Net, Mono, Java versus C++ and Forms, WPF, Swing versus MFC
// NativeCPPPerf.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <windows.h>
#include <conio.h>
#include <Psapi.h>
#pragma comment(lib, "Psapi.lib")

int _tmain(int argc, _TCHAR* argv[])
{

    FILETIME   ft;
    GetSystemTimeAsFileTime(&ft);
	static const __int64 startEpoch2 = 0; // 1601/1/1
    if( argc < 2 )
    {
	::Sleep(5000);
	return -1;
    }
	FILETIME userTime;
	FILETIME kernelTime;
	FILETIME createTime;
	FILETIME exitTime;

	if(GetProcessTimes(GetCurrentProcess(), &createTime, &exitTime, &kernelTime, &userTime))
	{
	  __int64 diff;
	  __int64 *pMainEntryTime = reinterpret_cast<__int64 *>(&ft);
	  _int64 launchTime = _tstoi64(argv[1]);
	  diff = (*pMainEntryTime -launchTime)/10000;	
	  return (int)diff;
	}
	else
		return -1;
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
United States United States
Decebal Mihailescu is a software engineer with interest in .Net, C# and C++.

Comments and Discussions