Welcome to mirror list, hosted at ThFree Co, Russian Federation.

Profile.cs « System.Xml « System.XML « class « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d16049576d1aa723f967857225717bb4272a2cca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
//
// Profile.cs
//
// Author:
//   Jason Diamond (jason@injektilo.org)
//
// (C) 2001 Jason Diamond  http://injektilo.org/
//

using System;
using System.Xml;

using System.IO;
using System.Text;

public class Profile
{
	public static void Main(string[] args)
	{
		XmlReader xmlReader = null;

		if (args.Length < 1)
		{
			xmlReader = new XmlTextReader(Console.In);
		}
		else
		{
			xmlReader = new XmlTextReader(args[0]);
		}

		int nodes = 0;

		DateTime start = DateTime.Now;

		while (xmlReader.Read())
		{
			++nodes;
		}

		DateTime end = DateTime.Now;

		Console.WriteLine("time = {0}", end - start);

		Console.WriteLine("nodes = {0}", nodes);
	}
}