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?
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?
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.