After running top, do SHIFT + m (i.e. Uppercase M).
From man top
SORTING of task window For compatibility, this top supports most of the former top sort keys. Since this is primarily a service to former top users, these commands do not appear on any help screen. command sorted-field supported A start time (non-display) No M %MEM Yes N PID Yes P %CPU Yes T TIME+ Yes
So SHIFT + t would sort by running time.
Once you have the pid and want to investigate further, do ps -o cmd fp PID to find out what’s the corresponding command.