최대 1 분 소요

시간 차이 구하기


	SYSTEMTIME tm;
	SYSTEMTIME tm_diff;
	GetLocalTime(&tm);
	clock_t start_test = 0, end_test = 0;

	CString fname = NULL;
	fname.Format("현재 시간 %0d-%02d-%03d\n", tm.wMinute, tm.wSecond, tm.wMilliseconds);
	OutputDebugString(fname);
	start_test = clock();
	if (end_test == 0)
	{
		end_test = clock();
	}

    /*
    시간이 걸리는 작업
    */

	double timeSecond = (double)(start_test - end_test); // 초 단위 변환
	CString time_diff = NULL;
	time_diff.Format("시간 차이 %f\n", timeSecond);
	end_test = start_test;
	OutputDebugString(time_diff);


태그:

카테고리:

업데이트:

댓글남기기