janet-lang / janet

A dynamic language and bytecode vm
https://janet-lang.org
MIT License
3.38k stars 217 forks source link

Add additional format options for os/clock #1432

Closed wishdev closed 2 months ago

wishdev commented 3 months ago

Allows for more flexibility in the returned value from os/clock

sogaiu commented 3 months ago

Some minor things about the proposed docstring:

For this bit of text in the docstring:

{seconds, nanoseconds}

May be it's better to not use curly braces as that's what's used for the literal syntax of structs.

Perhaps square brackets would work better?

Also, slight typo here?

  • :int: Return the number of seconds as am integer

May be "an" is what was intended (not "am"), though may be there is some humor value...

wishdev commented 3 months ago

Fixed, thanks for the review!

sogaiu commented 3 months ago

Nice to have the tests :)

I tried the branch here manually successfully and the tests passed too.