Click here to Skip to main content
15,886,036 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.4K   1.3K   67  
What is the start-up and system performance overhead for .Net, Mono, Java versus C++ and Forms, WPF, Swing versus MFC
package JavaPerf;
public class StartupTest {


	public static void main(String[] args) {
		long mainEntryTime = System.currentTimeMillis();//miliseconds since since 1970/1/1
		int result = 0;
		if (args.length > 0)
		{
			//FileTimeUtc adjusted for java epoch
			long fileTimeUtc = Long.parseLong(args[0]);//100 nanoseconds units since 1601/1/1
			long launchTime = fileTimeUtc - 116444736000000000L;//100 nanoseconds units since 1970/1/1
			launchTime /= 10000;//miliseconds since since 1970/1/1
			result = (int)(mainEntryTime - launchTime);
			//System.out.println("startup time " + result+ " ms");
		}
		else
		{
			try
			{

				System.gc();
				System.runFinalization();
				Thread.sleep(5000);
			}
			catch (Exception e)
			{
				e.printStackTrace();
			}

		}
		java.lang.System.exit(result);

	}

}

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