[나크21] 캐주얼 미니스커트 치마바지 NK21-P-10
BLOG main image
분류 전체보기 (540)
▩▩ 개인공간 ▩▩ (124)
▩▩ 문화생활 ▩▩ (45)
▩▩ 게임 ▩▩ (211)
▩▩ 일러스트 ▩▩ (46)
▩▩ 프로그래밍 ▩▩ (73)
▩▩ 코스메틱 ▩▩ (1)
▩▩ 여행 ▩▩ (0)
* 셈틀 롤드컵 * (1)
반응형
Total
Today hit
Yesterday hit
▩▩ 프로그래밍 ▩▩/C#
반응형
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;

namespace test_thread
{
    class Program
    {
        static void Main(string[] args)
        {
            new Program();
        }

        public Program() {
            new Thread(new ThreadStart(Thread_Test1)).Start();
            new Thread(new ThreadStart(Thread_Test2)).Start();
        }

        public void Thread_Test1() {
            int i = 0;
            while(true) {
                Console.WriteLine("Thread_Test1 i = {0}", i++);
                Thread.Sleep((1000));
            }
        }

        public void Thread_Test2() {
            int i = 0;
            while(true) {
                Console.WriteLine("Thread_Test2 i = {0}", i++);
                Thread.Sleep(2500);
            }
        }

    }
}







using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;

namespace test_thread
{
    class Program
    {
        static void Main(string[] args)
        {
            new Program();
        }

        String Commander;
        Thread _thread;

        public Program() {
            _thread = new Thread(new ThreadStart(Thread_Test1));
            _thread.Start();
            while(true) {
                Commander = Console.ReadLine();
                if(Commander == "exit") {
                    _thread.Abort();
                    break;
                }
            }
            Console.WriteLine("");

        }


        public void Thread_Test1() {
            int i = 0;
            while(true) {
                Console.WriteLine((i++).ToString());
                Thread.Sleep(1000);
            }
        }


    }
}




'sssss' 는 내가 임의로 입력한 것



반응형