A lightweight Windows 64-bit port of the GNU time utility โ built using Visual Studio x64 Native Build Tools. This version replicates core time features such as real, user, and sys timing for any command-line process, and adds support for GNU-style formatting (-f) and output redirection (-o).
โThis is not
/usr/bin/time, but a compatible reimplementation targeted at native Windows users โ no WSL, MSYS2, or Cygwin required.
- โ Native Windows 64-bit executable (no dependencies)
- โ
Launches external programs and reports:
- real: wall clock time
- user: CPU time in user mode
- sys: CPU time in kernel mode
- โ
GNU-compatible formatting via
-f(supports%e,%U,%S) - โ
Output redirection via
-o filename - โ Forwards child process exit code
You must have Microsoft Visual Studio Build Tools (2019 or 2022) installed.
Search and launch:
x64 Native Tools Command Prompt for VS 2022
git clone https://github.com/ivosetyadi/gnutime.git
cd gnutimecl /O2 /Fe:gtime.exe gtime.cThis will produce gtime.exe โ a standalone, portable binary.
gtime ping 127.0.0.1 -n 3gtime -f "elapsed=%e user=%U sys=%S" ping 127.0.0.1 -n 2gtime -o time_result.txt -f "real=%e" myscript.bat| Code | Meaning |
|---|---|
%e |
Elapsed real time (wall clock) |
%U |
User CPU time |
%S |
System CPU time |
%% |
Literal % |
Note: Memory/I/O stats like
-vare not yet supported. Coming soon.
- No
-vor memory usage support (yet) - No support for complex nested shell commands (e.g., pipes or
sh -c) - Only available on Windows (compiled for 64-bit targets)
This implementation is provided under the MIT License.
It is not a direct fork of GNU time, but inspired by its functionality.