There have been multiple accounts created with the sole purpose of posting advertisement posts or replies containing unsolicited advertising.

Accounts which solely post advertisements, or persistently post them may be terminated.

[DISCUSS] bmakelib - generate high resolution timestamp

bmakelib is a minimalist standard library for writing Makefiles.

What do you think about being able to easily generate µsecond precision timestamps in a Makefile?

https://lemmy.ml/pictrs/image/f26d4c81-51d1-4dba-8c6f-29d61ae80ca8.png

Please take a second to look at github.com/bahmanm/bmakelib/issues/42 & share your thoughts/emojis 🙏

killeronthecorner ,
@killeronthecorner@lemmy.world avatar

I guess the question is: what are you generating where this is a possibility of overlap within the de facto resolution? I can’t see filesystem writes needing this level of (nanosecond) accuracy within my lifetime, but happy to be corrected.

Feels borderline YAGNI, but also curious if there are real usecases for this. If there are I expect they are related to low level build activities and not high level I/O operations.

bahmanm OP ,
@bahmanm@lemmy.ml avatar

Good point 👍

Likewise, I never thought I’d need any timestamp w/ a finer resolution than millis, until my tests started failing:

There is a feature in bmakelib (called !!logged) which logs the stdout/err of a given target to disk. When I was writing tests for it, I noticed that occasionally my tests fail where they shouldn’t have (for context, the tests used to create files w/ millis resolution and then check the contents.) Turned out the my tests were fast enough that more than 1 of them would run and finish in a single millisecond causing the “expected” files to be overwritten.

That’s how I got to thinking that it may be something which can be added to bmakelib.

The benefit is that you don’t need to do much and you ensure the timestamp has a high resolution. That will make it harder to produce difficult-to-debug bugs 😅

The downsides are 1) cognitive load (yet another thing to know about) 2) filenames/variables/… will have 3 extra characters which stand for µ fraction.

Does that make sense?

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • [email protected]
  • lifeLocal
  • goranko
  • All magazines