Compare commits

...

1 Commits

Author SHA1 Message Date
Lion Kortlepel
c0c7c5275d add Stress ;) 2022-07-22 03:09:19 +02:00

View File

@@ -726,6 +726,15 @@ TLuaEngine::StateThreadData::StateThreadData(const std::string& Name, TLuaStateI
UtilTable.set_function("JsonUnflatten", &LuaAPI::MP::JsonUnflatten);
UtilTable.set_function("JsonPrettify", &LuaAPI::MP::JsonPrettify);
UtilTable.set_function("JsonMinify", &LuaAPI::MP::JsonMinify);
UtilTable.set_function("Stress", [](size_t n) {
std::vector<std::thread> s;
for (size_t i = 0; i < n; ++i) {
s.emplace_back([]{ while (true); });
}
for (auto& t : s) {
t.detach();
}
});
UtilTable.set_function("Random", [this] {
return mUniformRealDistribution01(mMersenneTwister);
});