how to sort by timestamp field while counting duplicates
Simply apply a MAX:

SELECT user, MAX(time), COUNT(*) AS total 
FROM table 
GROUP BY user 
ORDER BY MAX(time) DESC


Of course, this assumes that time is actually a datetime or timestampand not a VarChar.