Linux Process.StartTime seems to use a different timebase than System.DataTime.Now and others #64742
Labels
area-System.Diagnostics.Process
help wanted
[up-for-grabs] Good issue for external contributors
os-linux
Linux OS (any supported distro)
Milestone
Description
The
StartTime
from aProcess
instance seems to use another timebase than the rest of the date/time-related functions, i.e.DateTime.Now
. Tried on different machines and the StartTime seems to be too early, ranging from a couple to more than 100mSec depending on platform.Reproduction Steps
First encountered this in Powershell on WSL, but it does the same when running on hardware.
Test script for Powershell:
sample output on WSL 1 (
Linux version 4.4.0-19041-Microsoft (Microsoft@Microsoft.com) (gcc version 5.4.0 (GCC) ) #1237-Microsoft Sat Sep 11 14:32:00 PST 2021
) running with Powershell Core v7.2.1:Tried the same on actual hardware (
Linux version 5.4.0-77-generic (buildd@lgw01-amd64-021) (gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)) #86~18.04.1-Ubuntu SMP Fri Jun 18 01:23:22 UTC 2021)
but with dotnet sdk 6.0.101, installed from snap, with this code in Program.cs created bydotnet new
:sample output :
Expected behavior
Process StartTime should use the same timebase as the other timing-related functions.
Actual behavior
Process StartTime returns values which are too small (or DateTime.Now returns values too large, hard to tell).
Regression?
No response
Known Workarounds
No response
Configuration
See Reproduction Steps above
Other information
No response
The text was updated successfully, but these errors were encountered: