People probably do this based on experience. You know from the wall clock time that you slept, say 7 hours. So on a daily basis, you know what 7 hours of sleep feels like and from that you can extrapolate: if you think you slept about half as much, maybe it was 3 hours. Kind of thing.