Code example displaing time for 3 seconds.
Code example displaing time for 3 seconds.
#define BJ_AUTOMAIN_CALLBACKS
#include <banjo/main.h>
int bj_app_begin(void** user_data, int argc, char* argv[]) {
(void)user_data; (void)argc; (void)argv;
return bj_callback_exit_error;
}
return bj_callback_continue;
}
int bj_app_iterate(void* user_data) {
(void)user_data;
return elapsed >= 3.0 ? bj_callback_exit_success : bj_callback_continue;
}
int bj_app_end(void* user_data, int status) {
(void)user_data;
return status;
}
uint32_t code
Error code.
Definition error.h:132
char message[BJ_ERROR_MESSAGE_MAX_LEN+1]
Optional error description.
Definition error.h:133
Error structure.
Definition error.h:131
#define bj_trace(...)
Log a message using the BJ_LOG_TRACE level.
Definition log.h:75
#define bj_err(...)
Log a message using the BJ_LOG_ERROR level.
Definition log.h:131
void bj_end(bj_error **p_error)
De-initializes the system.
bj_bool bj_begin(bj_error **p_error)
Initializes the system.
void bj_sleep(int milliseconds)
Suspends the current thread for a specified duration.
double bj_get_time(void)
Gets the current time in seconds.
Logging utility functions.
Header file for system interactions.
Header file for time manipulation.