Skip to content
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

Task<T>.WithTimeout() TimeSpan overload should use TotalMilliseconds instead of Milliseconds #8

Closed
AdamDotNet opened this issue Jan 20, 2017 · 1 comment

Comments

@AdamDotNet
Copy link

https://github.com/jamesmontemagno/mvvm-helpers/blob/master/MvvmHelpers/Utils.cs

TimeSpan.TotalMilliseconds converts the entire TimeSpan to milliseconds, whereas TimeSpan.Milliseconds simply returns the milliseconds portion of the timespan. If I wanted to timeout in 10 seconds, and used

Task task; //...
await task.WithTimeout(TimeSpan.FromSeconds(10));

I would get a timeout of 0 milliseconds instead of 10000 milliseconds.

@jamesmontemagno
Copy link
Owner

Fixed. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants