rhtoras while i am working the computer is shutting down after 4 minutes. When i press the power button it returns where i was.
Is the computer actually shutting down, the monitor blanking, or something else?
If the computer is actually shutting down and coming back in the same state as it left, I'd suspect apmd is misconfigured and sending you into hibernation - check the apmd_flags in /etc/rc.conf.local. You would also see a message about unhibernating during boot.
If the monitor is blanking, check the monitor's settings through the monitor's built-in menu - the buttons will be different on different models, but usually there are power-saving settings and light/motion sensors, check any timers and automatic dimming settings.