Redbean doc update (#221)

- Update redbean documentation for consistency and fix typo (#97)
- Update redbean constants for consistency
- Add Fetch documentation to redbean (#97)
This commit is contained in:
Paul Kulchenko 2021-08-03 17:57:15 -07:00 committed by GitHub
parent f7b4804251
commit 344d2dc356
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 9 deletions

View file

@ -1172,8 +1172,8 @@ static void AppendResourceReport(struct rusage *ru, const char *nl) {
if (ru->ru_maxrss) {
Append("ballooned to %,ldkb in size%s", ru->ru_maxrss, nl);
}
if ((utime = ru->ru_utime.tv_sec * 1000000 + ru->ru_utime.tv_usec) |
(stime = ru->ru_stime.tv_sec * 1000000 + ru->ru_stime.tv_usec)) {
if ((utime = ru->ru_utime.tv_sec * 1e6 + ru->ru_utime.tv_usec) |
(stime = ru->ru_stime.tv_sec * 1e6 + ru->ru_stime.tv_usec)) {
ticks = ceill((long double)(utime + stime) / (1000000.L / CLK_TCK));
Append("needed %,ldµs cpu (%d%% kernel)%s", utime + stime,
(int)((long double)stime / (utime + stime) * 100), nl);
@ -1223,8 +1223,8 @@ static void AppendResourceReport(struct rusage *ru, const char *nl) {
static void AddTimeval(struct timeval *x, const struct timeval *y) {
x->tv_sec += y->tv_sec;
x->tv_usec += y->tv_usec;
if (x->tv_usec >= 1000000) {
x->tv_usec -= 1000000;
if (x->tv_usec >= 1e6) {
x->tv_usec -= 1e6;
x->tv_sec += 1;
}
}
@ -4886,7 +4886,7 @@ static int LuaLog(lua_State *L) {
}
static int LuaSleep(lua_State *L) {
usleep(1000000 * luaL_checknumber(L, 1));
usleep(1e6 * luaL_checknumber(L, 1));
return 0;
}