transit-lang-cmp icon indicating copy to clipboard operation
transit-lang-cmp copied to clipboard

C# did "something"

Open SirRufo opened this issue 2 years ago • 0 comments

https://github.com/losvedir/transit-lang-cmp/blob/cccd963fa531a40b710d940643cf12469f17c215/README.md?plain=1#L205

At one point I had a bug because I did a stopWatch.Elapsed / 1000 by accident instead of stopWatch.ElapsedTicks / 1000. The former is a TimeSpan struct instead of a long like ElapsedTicks, so intuitively it feels like I shouldn't be able to divide it, though it did a best effort and did something to it, though I'm not quite sure what.

That is basic math like

4a / 2 = 2a

or in words 4 apples divided by 2 are 2 apples. The division does not change the fact that we have apples or in case of your "bug" a TimeSpan.

Your desired result is in (stopWatch.Elapsed / 1000).Ticks see dotnet.fiddle

SirRufo avatar Nov 27 '22 09:11 SirRufo