flush every period

This commit is contained in:
gabime
2014-03-01 14:06:58 +02:00
parent 6f4c780089
commit ddcf45d65f
11 changed files with 105 additions and 76 deletions

View File

@@ -19,6 +19,16 @@ std::string format(const T& value)
return ss.str();
}
template<>
std::string format(const double & value)
{
static std::locale loc("");
std::stringstream ss;
ss.imbue(loc);
ss << std::fixed << std::setprecision(1) << value;
return ss.str();
}
inline void bench(const std::string& fn_name, const std::chrono::milliseconds &duration, const std::function<void() >& fn)
{
using namespace std::chrono;