Willing to pay for a simple "single-held-button-time-counter"

Here's my simple project that's in need of better code:

Lol I currently don't have any code =\

So, better means "anything more than nothing".

void setup()
{
}

void loop()
{
}

There you go. That's better than nothing. You owe me $10. 8)

void loop()
{
   unsigned long upTime = millis(); // up time is in milliseconds

   unsigned long upSeconds = upTime/1000; // up time is now in seconds

   unsigned long upHours = upSeconds / 3600; // get the up time in hours

   upSeconds -= upHours * 3600; // subtract whole hours

   unsigned long upMinutes = upSeconds / 60; // Get the minutes from the seconds

   upSeconds -= upMinutes * 60; // subtract whole minutes

   DisplayUpTime(upHours, upMinutes, upSeconds);

Now, all you have to do is write the DisplayUpTime() function to display the up time on the hardware you have, where you want it.

Create some global variables to hold when the switch becomes pressed and when it becomes released. Look at the state change detection example, and see if you can determine when the set each one. Using this loop() function snippet as a starting point, post your best attempt to properly populate those two global variables, and we'll show you how to get pressedTime and idleTime from them.