#include "stdafx.h"
#include <windows.h>
#include <string>
#include <vector>
#include <deque>
#include <iostream>
#include <locale>
using namespace std;
enum SearchType ;
int DirsFound;
bool ListFiles(wstring path, wstring mask, vector<wstring>& files, int stype = STYPE_DEPTH)
do
else
}
} while (FindNextFile(hFind, &ffd) != 0);
if (GetLastError() != ERROR_NO_MORE_FILES)
FindClose(hFind);
hFind = INVALID_HANDLE_VALUE;
}
return true;
}
int CONST_listFiles = 0;
int CONST_repeats = 10;
int wmain(int argc, WCHAR* argv[])
else
*/
wcout << L"Total files found: " << files.size() << endl;
wcout << L"Total dirs found: " << DirsFound << endl;
DWORD stage0 = GetTickCount();
wcout << L"Running 'depth' searches..." << endl;
for (int i = 0; i < CONST_repeats; i++)
ListFiles(PathToSearch, L"*", files,STYPE_DEPTH);
DWORD stage1 = GetTickCount();
wcout << L"Running 'width' searches..." << endl;
for (int i = 0; i < CONST_repeats; i++)
ListFiles(PathToSearch, L"*", files,STYPE_WIDTH);
DWORD stage2 = GetTickCount();
wcout << L"Statistics: (searches of each type were repeated " << CONST_repeats << L" times)" << endl;
wcout << L" - Depth searches (ms):" << stage1-stage0 << endl;
wcout << L" - Width searches (ms):" << stage2-stage1 << endl;
wcout << endl << L"Press any key to continue..." ;
wcin.get();
return 0;
}