2013-02-13 6 views
0

이 코드를 컴파일하려고하면 "GetClickCount identifier not found"오류가 발생하는 이유가 확실하지 않습니다. (GetClickCount64와 동일한 오류가 발생합니다.) 나는 누군가가 설명 할 수 있기를 바랬다. 문제에 대한 나의 견해 대부분은 코드에 #include가 없다는 것을 나타내는 것 같지만 분명히 내 문제는 아닙니다.GetTickCount() 식별자를 찾을 수 없습니다.

#include <Windows.h> 
#include "stdafx.h" 
#include "InSort.h" 
#include "DataSet.h" 

using namespace std; 
using namespace System; 

ref class Test 
{ 
public: 

    Test(){} 

    // TestInsertSortProcedure() method tests the InsertSort process for the duration 
    // of the sorting proceedure by checking the time prior to and after the SortCollection() 
    // method has run on five different lengths of the array being sorted, each subsequent length 
    // being 10-fold greater than the previous length 
    void TestInsertSortProcedure() 
    { 
     int start; 
     int finish; 
     int total; 
     unsigned int increment; 
     InSort<int>^ myInsertSorter = gcnew InSort<int>(); 

     for (increment = 1; increment < 1000000; increment = increment * 10) 
     { 
      // get new dataset with new number of elements equal to increment value 
      Dataset^ myDataArray = gcnew Dataset(increment); 

      // Timestamp prior to sorting: 
      start = GetTickCount(); 

      // Sort collection 
      myInsertSorter->SortCollection(myDataArray->unsortedArray); 

      // Timestamp at completion of sorting 
      finish = GetTickCount(); 
      total = finish - start; 

      // Print result to console 
      Console::WriteLine(L"Sorting time in milliseconds was: " + total); 
     } 
    } 
}; 

int main(array<System::String ^> ^args) 
{ 
Test^ testing = gcnew Test(); 
testing->TestInsertSortProcedure(); 

return 0; 
} 
+0

의 GetTickCount 무엇입니까 사용해보십시오()? 환경 :: TickCount를 찾고 계십니까? – Pete

+0

음, MS에서 시스템 시간을 반환하는 방법이라고 생각했습니다. 나는 그것에 붙어 있지는 않지만, 나는이 정렬 방법의 시간을 정하는 방법을 알아 내려고 노력하면서 O (n^2)의 그래프 (그리고 그것들을 추가 할 때 다른 정렬 방법)를 그릴 수 있습니다. – deadEddie

+0

네, 그렇습니다. Environment :: TickCount는 제가 찾고있는 곳이었습니다. dat을 대답으로 여기에 받아 들여서 받아 들여지는 것을 생각하십시오 :) – deadEddie

답변

1

Environment::TickCount

+0

당신 da man !!! 정확히 내가하려고했던 것. – deadEddie

관련 문제