-13

Is there a way to find how many hours I spent on SO. Also who has spent most number hours on SO(probably Jon Skeet ;)).

Is there such option available. If No then adding will be good. What you guys say?

5
  • 2
    Your supervisor knows that number, ask her. Commented Dec 12, 2015 at 8:10
  • 1
    asked, she dont know it seems Commented Dec 12, 2015 at 8:15
  • I care, then why visited dates are available in profile Commented Dec 12, 2015 at 8:29
  • I dunno. It seems a bit silly to me. I do apologize if my previous comment came across as abrasive, but the amount of time I've spent on Stack Overflow is both immaterial and largely unhelpful information to anyone else, at least in my assessment.
    – Makoto
    Commented Dec 12, 2015 at 8:32
  • 5
    It's going to be impossible for Stack Overflow to track this, because it can't see when you're accessing off-site resources like manuals. You'd have to do this yourself, for example using one of the many time tracker programs available
    – Pekka
    Commented Dec 12, 2015 at 8:43

1 Answer 1

10

Until last Sunday you have lost 2892 hours of your life on Stack Overflow based on a very rough, non-statistical sound approach using data available in SEDE

Here is the query:

with timeevents as
(
select creationdate
     , len(body) as length
     , case 
       when posttypeid = 1 then 'Q'
       when posttypeid = 2 then 'A'
       end as type
from posts
where owneruserid = ##userid:int##
union
select creationdate
     , len([text]) 
     , 'C'
from comments
where userid = ##userid:int##
)
, numbered as (
select row_number() over(order by creationdate) as eventnum
     , creationdate
     , length
     , type
from timeevents
)
, minutes_between_events as (
select datediff(n, s.creationdate, e.creationdate) as span
     , cast(s.eventnum as nvarchar) 
     + ' - ' 
     + cast(e.eventnum as nvarchar) as evm
     , s.length + e.length as totlen
     , s.type + e.type as types
from numbered s
inner join numbered e on s.eventnum + 1 = e.eventnum 
)

select count(*) as [hours lost of your life]
, count(*) / 24 as [days lost of your life]
from  minutes_between_events 
where span < 60

What I try here is to combine known events that are recorded with their creationdate that are directly linked to you. I assign eventnumbers to them so I can calculate the difference between two events in minutes. Every event that takes less than 60 minutes is considered to be an hour. This might skew the results heavily in hours where you commented a lot in a short period but I expect that to compensate a bit for the events that are wider apart.

One other approach I did consider but didn't convert to a working query is the number of characters in each post. In the first CTE called timeevents I pick that number. If you multiply that with the average number of chars per minute you can type you might get a closer estimate.

2
  • 6
    That query claims I've spent just over 10 years on SO. Gotta love time machines. (Not a criticism - you did say it's very rough. Just thought you might find it amusing.)
    – Jon Skeet
    Commented Dec 12, 2015 at 13:44
  • 4
    Don't worry @JonSkeet I'll keep it secret that you have spend too many years here ;)
    – rene
    Commented Dec 12, 2015 at 13:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .