1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-16 11:33:03 +01:00

report object scan time

This commit is contained in:
Ted John
2016-06-26 22:38:33 +01:00
parent 12f48f36b5
commit 84bd948488
2 changed files with 12 additions and 3 deletions

View File

@@ -24,6 +24,7 @@
#include "../core/IStream.hpp"
#include "../core/Memory.hpp"
#include "../core/Path.hpp"
#include "../core/Stopwatch.hpp"
#include "../core/String.hpp"
#include "Object.h"
#include "ObjectFactory.h"
@@ -176,6 +177,11 @@ private:
utf8 objectDirectory[MAX_PATH];
Path::GetDirectory(objectDirectory, sizeof(objectDirectory), gRCT2AddressObjectDataPath);
Console::WriteLine("Scanning objects...");
auto stopwatch = Stopwatch();
stopwatch.Start();
int enumFileHandle = platform_enumerate_files_begin(gRCT2AddressObjectDataPath);
if (enumFileHandle != INVALID_HANDLE)
{
@@ -190,6 +196,9 @@ private:
}
platform_enumerate_files_end(enumFileHandle);
}
stopwatch.Stop();
Console::WriteLine("Scanning complete in %.2f seconds.", stopwatch.GetElapsedMilliseconds() / 1000.0f);
}
void ScanObject(utf8 * path)
@@ -228,7 +237,7 @@ private:
}
return true;
}
log_info("Object repository is out of date.");
Console::WriteLine("Object repository is out of date.");
return false;
}
catch (IOException ex)