How is time spent online recorded? What functions are used and what files are they in?
from admin/Configuration/ Online 15 now does not want to figure
There isn't a specific function. Basically, if the user is online a part of the code figures out how many seconds it's been since they've last been active, and then updates it in the database.
You can see the code in ./inc/class_session.php, around line 200.