MLV_time.h(3)

📦
version 3.1.0 · 2 versions
, in ubuntu jammy

✨ NAME ✨

okay so bestie, welcome to MLV_time.h, section 3 of the Library Functions Manual 💖 this is the header file that defines every single prototype for all the functions dealing with time management. clock stuff. timing stuff. the whole vibe. 🕰️✨


🌸 SYNOPSIS 🌸

Fonctions 💅

  • void MLV_wait_milliseconds (int milliseconds) — the program pauses itself for however many milliseconds you pass in. nap time, but make it code 😴
  • void MLV_wait_seconds (int seconds) — the program pauses itself for a given number of seconds.
  • int MLV_get_time () — hands you back the number of milliseconds that have gone by since the MLV library started initialising (i.e. since MLV_create_window). ⏱️
  • int MLV_get_date (int *seconds, int *minutes, int *hours, int *day, int *month, int *year, int *day_of_the_week) — gives you today's date (second / hour / day / month / year). 📅
  • void MLV_change_frame_rate (int rate) — sets the refresh rate, in Hz.
  • int MLV_get_frame_rate () — gives you back the current refresh rate.
  • void MLV_delay_according_to_frame_rate () — suspends the program's execution so that the time elapsed since the last call to this function is exactly equal to the period of the refresh rate you configured with MLV_change_frame_rate. lowkey genius fr 🧚

🦋 Description détaillée 🦋

This file defines all the prototypes for the functions concerning time management. that's it, that's the whole thesis 💜

Auteur ✨

  • Adrien Boussicault
  • Marc Zipstein

📚 Documentation des fonctions 📚

void MLV_change_frame_rate (int rate) 💅

Sets the refresh rate in Hz. The default refresh rate is 100 Hz. What that means is: if you call MLV_delay_according_to_frame_rate() between every refresh of the graphical window, you get a refresh of 100 images per second. iconic behaviour honestly 🔥

Paramètres

  • rate — the refresh rate.

Exemples

advanced/09_animation.c, and advanced/11_animation_book.c.


int MLV_get_date (int * seconds, int * minutes, int * hours, int * day, int * month, int * year, int * day_of_the_week) 📅

Gives you today's date (second / hour / day / month / year). The year is given counting from year 0.

You can totally pass a null value as a parameter to this function — in that case, that parameter just gets ignored by the function. no stress, no drama 🫶

Paramètres

  • seconds — the number of seconds elapsed since the last change of minute.
  • minutes — the number of minutes elapsed since the last change of hour.
  • hours — the number of hours elapsed since midnight.
  • day — the day of the month.
  • month — the number of months elapsed since the start of the year.
  • year — the number of years since year 0.
  • day_of_the_week — the day of the week ( 0: Lundi, 1: Mardi, ..., 6: Dimanche).

Renvoie

Returns 1 if the winter-time / summer-time offset was taken into account, 0 if it was not, and -1 if the information isn't available. three moods, one int 💀

Exemples

medium/07_time.c.


int MLV_get_frame_rate () 👑

Gives you the current refresh rate.

Renvoie

The current refresh rate. that's it, she's simple and she slays ✨


int MLV_get_time () ⏱️

Returns the number of milliseconds elapsed since the MLV library began initialising (with MLV_create_window).

Renvoie

The time elapsed since the MLV library was initialised.

Exemples

medium/05_exit.c, and medium/07_time.c.


void MLV_wait_milliseconds (int milliseconds) 😴

The program pauses itself for a number of milliseconds given as a parameter.

Paramètres

  • milliseconds — the number of milliseconds to wait.

Exemples

beginner/08_mouse_keyboard_input_box_timer.c.


void MLV_wait_seconds (int seconds) 🛌

The program pauses itself for a number of seconds.

Paramètres

  • seconds — the number of seconds to wait.

Exemples

advanced/01_texts_and_boxes.c, advanced/02_font.c, advanced/03_music.c, advanced/05_playlist.c, advanced/06_image.c, advanced/07_transparency.c, beginner/01_hello_world.c, beginner/02_shapes.c, beginner/04_texts_and_boxes.c, beginner/05_mouse.c, beginner/06_keyboard.c, beginner/07_input_box.c, beginner/11_turtle.c, medium/05_exit.c, medium/09_keyboard_accents.c, and medium/12_desktop_size.c. that's a lot of examples bestie, she's popular 💅


👑 Auteur 👑

Generated automatically by Doxygen for MLV-3.1.0 from the source code.


and that's the whole page, bestie!! 🎀 this little legend was auto-generated by Doxygen for MLV-3.1.0, and it was dated Samedi 29 Janvier 2022 — yes, a Saturday, the weekend, and she still showed up looking this good. go take a nap with MLV_wait_seconds, you earned it 🌸💖🦋

📦 where this page comes from