STRELAPSED(3)

πŸ“¦ version 93vu, in opensuse-leap 16.0

πŸ’… NAME

ok so strelapsed β€” the girlies who parse elapsed time expressions ✨

(also hi, you're reading the Library Functions Manual, section 3, we love a classic πŸŽ€)


✨ SYNOPSIS ✨

unsigned long strelapsed(char* buf, char** next, int persec)

like literally that's the whole vibe, three args, one unsigned long, periodt πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so picture this: strelapsed gives you back a pointer to a string representation of the elapsed time for (count/persec) seconds 🫢 that's the whole job bestie.

and the way it does it is lowkey iconic β€” it only ever uses the two largest time units, which keeps the return value length capped at at most 6 characters. efficiency queen πŸ‘‘ no rambling, no extra syllables, just slay.

the units it works with, in order:

  • s β€” seconds
  • m β€” minutes
  • h β€” hours
  • days β€” days (yes, no cute lil letter for this one, it said what it said πŸ™ˆ)
  • weeks β€” weeks
  • M β€” months (capital M bestie, do not confuse her with minutes fr fr)
  • Y β€” years
  • S β€” scores

ngl the case sensitivity on m vs M vs s vs S is giving main character energy β€” keep up iykyk πŸŒ€

real talk though: the synopsis says the return type is unsigned long while the description talks about a pointer to a string. both are quoted here exactly as written β€” i'm not out here fixing the manpage, i'm just reporting the drama πŸ’€

🌈 SEE ALSO 🌈

  • strelapsed(3) β€” yes she references herself. self-love, honestly iconic ✨

πŸ’€ CAVEATS πŸ’€

⚠️ the return value points to a static area that gets overwritten on each call. so if you hold onto that pointer and call her again? girl. it's gone. copy it out if you need it to survive, bestie 😭

and that's the page! πŸ’– this was the Library Functions Manual entry for STRELAPSED(3) β€” no version number or date was given on the original footer, so we're just signing off with the name and a kiss 🫢✨

πŸ“¦ where this page comes from