Docs: Bilisecond (long-lasting bug in documentation)

Created on 21 Aug 2018  Â·  5Comments  Â·  Source: dotnet/docs

There is no such thing as a bilisecond., and the 'bilisecond' parameter actually represents a number of microseconds (millionth of a second). A billionth of a second would be a nanosecond.

The statement new System.Data.SqlTypes.SqlDateTime(2018,1,1,10,0,0,500000) returns a value with 500 milliseconds.
The statement new System.Data.SqlTypes.SqlDateTime(2018,1,1,10,0,0,2000000) throws a SqlTypeException.


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Area - API Reference

Most helpful comment

@douglaslMS

You're right that "nanosecond" would be correct here.

No, "microsecond" would be correct. And I think the documentation should use that name to describe the value here.

Another way to verify that is to look at the source code: the bilisecond value is divided by 1000 and the result is passed to the double millisecond parameter of the other constructor overload. This means the bilisecond value represents thousandths of millisecond, or in other words, microseconds.

However these API reference docs are autogenerated from code comments, and the code itself uses the unfortunate "bilisecond."

Yes, the parameter name shouldn't be changed. If it was changed in the code, that would be a breaking change.

All 5 comments

@MikeRosoft You're right that "nanosecond" would be correct here. However these API reference docs are autogenerated from code comments, and the code itself uses the unfortunate "bilisecond." If I update the doc page manually, it's only a matter of weeks before my fix is overwritten by an autogenerated sync to the code. In other words, fixing this would require a code bug, which (frankly) would probably be prioritized very low in this older .NET code.

@douglaslMS

You're right that "nanosecond" would be correct here.

No, "microsecond" would be correct. And I think the documentation should use that name to describe the value here.

Another way to verify that is to look at the source code: the bilisecond value is divided by 1000 and the result is passed to the double millisecond parameter of the other constructor overload. This means the bilisecond value represents thousandths of millisecond, or in other words, microseconds.

However these API reference docs are autogenerated from code comments, and the code itself uses the unfortunate "bilisecond."

Yes, the parameter name shouldn't be changed. If it was changed in the code, that would be a breaking change.

You can update the non-automated parts @douglaslMS. The .NET reference is not auto-generated from /// comments. Just the skeleton of the page is auto-generated.

@douglaslMS while the signature cannot be changed, the description of both the constructor and the argument can be updated to use the word "microsecond" (as @mairaw has just mentioned).

@svick @pkulikov Thank you for explaining what's in the source code. I have made the suggested corrections.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gmatv picture gmatv  Â·  3Comments

mekomlusa picture mekomlusa  Â·  3Comments

skylerberg picture skylerberg  Â·  3Comments

ike86 picture ike86  Â·  3Comments

Eilon picture Eilon  Â·  3Comments