using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
using System.Threading.Tasks;
namespace ConsoleApplication3
{
class Program
{
static void Main(string[] args)
{
int time = 0, time2=0;
StringBuilder str = new StringBuilder();
ArrayList list = new ArrayList();
for (int i = 0; i < 100000; i++)
{
list.Add("이재민" + i);
}
time = Environment.TickCount;
// 병렬처리 코드
//Parallel.For(0, list.Count - 1, i=> { str.Append(list[i++] + ", "); });
//str.Append(list[list.Count - 1] + "\n\n");
//Console.WriteLine(str);
// 단일처리 코드
//for (int i = 0; i < list.Count - 1; str.Append(list[i++] + ", ")) { }
//str.Append(list[list.Count - 1] + "\n\n");
//Console.WriteLine(str);
time2 = Environment.TickCount;
Console.WriteLine(time2 - time);
}
}
}
'Hoons.Net > C#' 카테고리의 다른 글
| 캠퍼스 시삽 과제 5-1) Delegate (0) | 2012.08.23 |
|---|---|
| 캠퍼스 시삽 과제 4-1) Stream (0) | 2012.08.13 |
| 캠퍼스 시삽 과제 3-2) 컬렉션 점찍어 출력하기(While Ver.) (0) | 2012.08.13 |
| 캠퍼스 시삽 과제 3-2) 컬렉션 점찍어 출력하기(StringBuilder Ver.) (0) | 2012.08.10 |
| 캠퍼스 시삽 과제 3-2) 컬렉션 점찍어 출력하기 (0) | 2012.08.09 |