Maybe for you, but for some people they can stay up for longer
Also fun fact the Apollo astronauts never slept on the Moon (and they stayed there for about 24 hours), so some of them ended up being awake for more than 40 hours at a time
function getRandomInt(min, max) {
const minCeiled = Math.ceil(min);
const maxFloored = Math.floor(max);
return Math.floor(Math.random() * (maxFloored - minCeiled) + minCeiled); // The maximum is exclusive and the minimum is inclusive
}