-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NET6 - Stopwatch.ElapsedMilliseconds returns wrong result when using monoVM on linux-arm #61599
Comments
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
You don't have a fractional specifier in your format string, so are you sure the code being run is the code currently written (yes, I've seen your other issue). |
Sorry, should be: To be sure I'm going to retest it. |
You probably should use |
result (linux-arm, monoVM):
There are about 750 lines per second, so it's about 1-1.5ms for each line, but reported value is between 100-150 |
result in:
|
Maybe problem is with comething like CurrentCulture/Calendar Ticks per second or something like that. |
Unlikely, culture shouldn't be accessed for the stopwatch calculations. The most likely culprit is that the resolution translation code has an issue (in at least the windows APIs, timers return a tick count and a value giving the resolution). The other possibility is that whatever clock the stopwatch is using for timings just has a really bad resolution? |
Device is embedded board with Allwinner H3 board (Nano pi core). I tried it with mono 6.6 which I have on the system also and it seems ok: Program:
NET5 - ok |
Problem is already in Ticks:
So 1.4ms - 1432875Ticks
|
Tagging subscribers to this area: Issue DetailsDescriptionResults seem to be 100x bigger. Reproduction StepsI was testing minimal Thread.Sleep() time with following program:
deployed with and Expected behaviorExpected to return number of milliseconds elapsed. Actual behavior100x elapsed millisecods for mono VM. On screenshot first part is using monoVM, second default dotnet runtime. Regression?No response Known WorkaroundsNo response ConfigurationNo response Other informationTested on 32bit linux-arm on Yocto linux
|
So... there's no case where we don't want to assume hard float Fixes: dotnet#61598 Fixes: dotnet#61599
Description
Results seem to be 100x bigger.
Reproduction Steps
I was testing minimal Thread.Sleep() time with following program:
deployed with
dotnet publish -r linux-arm -p:PublishTrimmed=True -p:TrimMode=Link --self-contained true -c Release -f net6.0 -o bin\dotnet\mono -p:UseMonoRuntime=true
- for monoVMand
dotnet publish -r linux-arm -p:PublishTrimmed=True -p:TrimMode=Link --self-contained true -c Release -f net6.0 -o bin\dotnet
- for default dotnet runtimeExpected behavior
Expected to return number of milliseconds elapsed.
Actual behavior
100x elapsed millisecods for mono VM.
On screenshot first part is using monoVM, second default dotnet runtime.
Regression?
No response
Known Workarounds
No response
Configuration
No response
Other information
Tested on 32bit linux-arm on Yocto linux
The text was updated successfully, but these errors were encountered: