Obviousley i would need a timer but how do i get my app to logoff if the computer hasnt been touched for say 5 minutes??

I understand the:

load form1
form1.show

but how do i count the seconds since the mouse was last moved????