Hello,
For the resting system, Larian's game system (including DOS 1 and 2) does not use any notion of time in-game : quests and events are triggered by action not time. For example, you could stay one real hour beside a sick man, no problem, but as soon as you go away a certain distance, the script considers that you chose not to heal the guy... Real time is not a great solution as a player could just go AFK one hour.
It does not mean there is no solution :P For example, you may notice companions whining about being tired and feeling like now would be a good time to rest. I am not sure what they use as a trigger, but I am guessing it is after using x class resources or taking x damage, or what not. Maybe it is or could be based on distance travelled (if that is somehow measured by their engine).