This is the binary distribution of racket-webview

This commit is contained in:
2026-04-05 14:49:27 +02:00
parent 291bb0c545
commit b0ed617c50
149 changed files with 5047 additions and 28 deletions

51
utils.cpp Normal file
View File

@@ -0,0 +1,51 @@
#include "utils.h"
#include <chrono>
typedef struct {
std::chrono::time_point<std::chrono::system_clock> start;
} timer;
static int _log_level = LOG_INFO;
static timer *_timer = nullptr;
int logLevel()
{
return _log_level;
}
void setLogLevel(int l)
{
_log_level = l;
}
const char *logIndicator(int l)
{
switch(l) {
case LOG_ERROR: return "ERROR ";
case LOG_INFO: return "INFO ";
case LOG_DEBUG: return "DEBUG ";
case LOG_WARNING: return "WARNING";
}
return "UNKNOWN";
}
void logElapsed()
{
if (_timer == nullptr) {
_timer = new timer;
_timer->start = std::chrono::system_clock::now();
}
auto c = std::chrono::system_clock::now();
auto duration = c - _timer->start;
auto milliseconds
= std::chrono::duration_cast<std::chrono::milliseconds>(
duration)
.count();
fprintf(stderr, "%8.3lf: ", milliseconds/ 1000.0);
}