I am trying to monitor my app launch time on a Windows machine using command prompt. This is how I launch my electron app
powershell -command "(New-TimeSpan -Start (Get-Date "01/01/1970") -End (Get-Date)).TotalSeconds" & electron .
The time returned by command prompt looks hugely off. The following are values returned
- command prompt - 1706093824 (sec)
- electron app - 1706074025844 (msec)
In electron I am printing using
const now = Date.now(); // Unix timestamp in milliseconds
console.log( now );
Why is command prompt returning incorrect time? Can someone please suggest what am I doing wrong here?
As pointed out by @Stitt the time difference was due to local time zone. Subtracting it gave correct results.