Winix.TimeIt 0.3.0

Prefix Reserved
dotnet tool install --global Winix.TimeIt --version 0.3.0
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local Winix.TimeIt --version 0.3.0
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=Winix.TimeIt&version=0.3.0
                    
nuke :add-package Winix.TimeIt --version 0.3.0
                    

timeit

Time a command and show wall clock, CPU time, peak memory, and exit code.

A transparent wrapper — the child's stdout, stderr, and exit code pass through unmodified.

time equivalent for Windows (and works on Linux/macOS too).

Install

Scoop (Windows)

scoop bucket add winix https://github.com/Yortw/winix
scoop install winix/timeit

Winget (Windows, stable releases)

winget install Winix.TimeIt

.NET Tool (cross-platform)

dotnet tool install -g Winix.TimeIt

Direct Download

Download native binaries from GitHub Releases.

Usage

timeit [options] [--] <command> [args...]

Examples

# Time a build
timeit dotnet build

# JSON output for CI pipelines
timeit --json dotnet test

# One-line format for log files
timeit -1 dotnet publish -c Release

# Force colour even when piped
timeit --color dotnet build 2>&1 | tee build.log

# Use -- when child args look like timeit flags
timeit -- myapp --help

Output Formats

Default (multi-line, stderr):

  real  12.4s
  user  9.1s
  sys   0.300s
  peak  482.0 MB
  exit  0

One-line (-1 / --oneline):

[timeit] 12.4s wall | 9.1s user | 0.300s sys | 482.0 MB peak | exit 0

JSON (--json):

{"tool":"timeit","version":"0.1.0","exit_code":0,"exit_reason":"success","child_exit_code":0,"wall_seconds":12.400,"user_cpu_seconds":9.100,"sys_cpu_seconds":0.300,"cpu_seconds":9.400,"peak_memory_bytes":505413632}

Options

Option Description
-1, --oneline Single-line output format
--json JSON output format
--stdout Write summary to stdout instead of stderr
--describe Emit structured JSON metadata for AI agents
--no-color Disable colored output
--color Force colored output (even when piped)
--version Show version
-h, --help Show help

Exit Codes

timeit passes through the child process's exit code. When timeit itself fails:

Code Meaning
125 No command specified or bad timeit arguments
126 Command found but not executable, or bad EXE format
127 Command not found

Ambiguity warning: timeit's 125/126/127 collide with the same codes the child might return on its own. POSIX shells use 127 for "command not found" and timeit follows the convention, so an exit code of 127 from timeit -- foo could mean either "timeit could not find foo" or "foo ran and exited 127 itself" — the bare exit code can't distinguish. For unambiguous detection, use --json and check the exit_reason field: success means the child ran and child_exit_code is its exit code; any other value (usage_error, command_not_found, command_not_executable, start_error) indicates a timeit-side failure where the child never ran.

Colour

  • Automatic: colour when outputting to a terminal, plain when piped
  • --color forces colour on (overrides NO_COLOR)
  • --no-color forces colour off
  • Respects the NO_COLOR environment variable (no-color.org)

Part of Winix

timeit is part of the Winix CLI toolkit.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last Updated
0.3.0 102 5/26/2026
0.3.0-rc2 101 5/10/2026
0.2.0 110 4/16/2026
0.2.0-test4 105 4/15/2026
0.1.0 116 4/2/2026
0.1.0-preview.4 63 3/30/2026
0.1.0-preview.3 68 3/30/2026
0.1.0-preview.2 56 3/30/2026
0.1.0-preview.1 60 3/30/2026

## [0.3.0] - 2026-05-10

### Fixed
- Empty-command argument (`timeit ""` or just `timeit`) no longer leaks the `FileNameMissing` SR resource key under `InvariantGlobalization=true`. A proper user-facing English message now surfaces instead of the framework SR key.
- Empty-command path now routes the usage-error message to **stderr** (was stdout), so `timeit "" 2>/dev/null` no longer silently swallows the diagnostic.
- Bad-EXE invocation (Windows: `.cmd` / `.bat` files; POSIX: missing executable bit) now platform-gated correctly. The cross-platform behaviour gap that produced `IOException` on Windows but a clean error on POSIX is closed.
- Exit-code semantics corrected per documented contract — usage errors at 125, command-not-executable at 126, command-not-found at 127.
- `--version` output no longer carries the `+gitsha` SourceLink suffix. Users see plain `timeit 0.3.0`, matching the suite convention.

### Added
- Library seam `Winix.TimeIt.Cli.Run` for orchestration testing without process spawning.
- Documentation: README and man page now spell out exit-code semantics explicitly.

### Internal
- UTF-8 console adoption via `ConsoleEnv.UseUtf8Streams` so multi-byte argv round-trips correctly on Windows.
- Standard `<PackageTags>` set on the NuGet package.
- Platform-skipped tests migrated to `SkippableFact + Skip.IfNot` so per-OS branches no longer report as Passed on the wrong platform (CI false-positive class).

See full changelog at https://github.com/Yortw/winix/blob/main/src/timeit/CHANGELOG.md