ive had a idea for a project but dont no how to start

my mum keeps going on at me for spending to long on the internet so i want to create a program that detects the internet connection and starts a timer till you disconnect then records the time to a file so it can keep a running total

how could i make the program always be running bit not visible till you click a icon or sumtihng like that

also how would i detect the internet connection