12 inline std::string nvsl::ns_to_latex(
size_t ns,
const std::string &name,
13 nvsl::time_unit unit) {
14 std::string result =
"";
17 const auto name_fixed =
nvsl::zip(nvsl::split(name,
"_"),
"");
24 case nvsl::time_unit::s_unit:
25 result = to_latex(name_fixed, ns,
"~s", 1000000000);
27 case nvsl::time_unit::ms_unit:
28 result = to_latex(name_fixed, ns,
"~ms", 1000000);
30 case nvsl::time_unit::us_unit:
31 result = to_latex(name_fixed, ns,
"~\\us{}", 1000);
33 case nvsl::time_unit::ns_unit:
34 result = to_latex(name_fixed, ns,
"~ns", 1);
36 case nvsl::time_unit::any_unit:
38 result = to_latex(name_fixed, ns,
"~s", 1000000000);
40 result = to_latex(name_fixed, ns,
"~ms", 1000000);
42 result = to_latex(name_fixed, ns,
"~\\us{}", 1000);
44 result = to_latex(name_fixed, ns,
"~ns", 1);