NaviServer Built-in Commands – 5.2.0a
ns_baseunit - Convert time and memory-size units to seconds and bytes
Convert a memory size to bytes or a time value to seconds, using the same NaviServer converters used by other commands. Fractional seconds are preserved. This lets Tcl commands accept uniform unit-bearing arguments, for example when calculating cache partition sizes from values such as 2MB.
Either -size memory-size or -time time has to be specified. Valid time units are μs, ms, s, m, h, d, w, y. Valid size units are kB, MB, GB, KiB, MiB, GiB.
% ns_baseunit -size 10KiB 10240 % ns_baseunit -time 2.5h 9000 % ns_baseunit -time 1500ms 1.5