This commit is contained in:
John
2025-04-27 21:45:54 +12:00
parent b1e51b91d2
commit 66bc230f71
3 changed files with 34 additions and 33 deletions

View File

@@ -96,4 +96,14 @@ XXH64_hash_t hash_directory_recursive(const std::string &path) {
return hash;
}
void hash_demo(const std::string & path)
{
std::cout << "Hashing directory: " << path << std::endl;
auto start = std::chrono::high_resolution_clock::now();
XXH64_hash_t hash = hash_directory_recursive(path);
auto end = std::chrono::high_resolution_clock::now();
auto duration = std::chrono::duration_cast<std::chrono::milliseconds>(end - start);
std::cout << "Hash: " << hash << " (took " << duration.count() << "ms)" << std::endl;
}
} // namespace dropshell

View File

@@ -10,6 +10,8 @@ namespace dropshell {
XXH64_hash_t hash_directory_recursive(const std::string &path);
void hash_demo(const std::string & path);
} // namespace dropshell