Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

How can i record how long I'm in Unity?

Discussion in 'Editor & General Support' started by Ricachet, Jul 20, 2015.

  1. Ricachet

    Ricachet

    Joined:
    Jan 13, 2015
    Posts:
    6
    If anyone is familiar with how steam logs your "Played Hours" i was wondering if anyone knows or uses a tool that records how long you're running an app, in this case Unity.

    I want to do this because I feel that if I can see how long I'm using this, it'll not only motivate me to work more, but I can measure progress at a high level, in raw time of the app being opened.

    As I'm writing this i just got the idea of tricking Steam to think the Unity3d exe is a game. Haven't tried this yet.
     
  2. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,384
    Steam doesnt record hours on non-steam games.
     
  3. Ricachet

    Ricachet

    Joined:
    Jan 13, 2015
    Posts:
    6
    OIC.. thanks.
     
  4. mdrotar

    mdrotar

    Joined:
    Aug 26, 2013
    Posts:
    377
  5. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    I have an excel spreadsheet. I write in the time when I start and when I finish. I use subtraction to work out the actual time spent.
     
    zombiegorilla and LaneFox like this.
  6. darkhog

    darkhog

    Joined:
    Dec 4, 2012
    Posts:
    2,218
    I think editor extension could be developed for that. Like panel that updates each second (adds 1 to an uint), then based on amount of seconds calc how many hours and minutes passed as well and presents it in familiar hh:mm:ss format.
     
    Kiwasi likes this.
  7. Andy-Touch

    Andy-Touch

    A Moon Shaped Bool Unity Legend

    Joined:
    May 5, 2014
    Posts:
    1,445
    There is a really great app I use on OSX called 'Rescue Time' and it auto-logs time spent using each and every software on your machine. It also gives you a handy graph of your usage and an end-of week summary! :)

    Alot of freelancers I know use it to show people how long they spend working on contract projects; pretty useful!
     
    Ricachet and Baroni like this.
  8. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,102
    Something like this?
    Code (csharp):
    1.  
    2. using UnityEngine;
    3. using UnityEditor;
    4. using System;
    5.  
    6. [InitializeOnLoad]
    7. public class DevelopmentTimer : EditorWindow
    8. {
    9.    static TimeSpan initTime;
    10.  
    11.    static DevelopmentTimer()
    12.    {
    13.      initTime = TimeSpan.FromSeconds(EditorPrefs.GetInt ("DevTime", 0));
    14.    }
    15.  
    16.    [MenuItem("Window/Development Timer")]
    17.    static void Open()
    18.    {
    19.      DevelopmentTimer window = ScriptableObject.CreateInstance<DevelopmentTimer> ();
    20.      window.ShowUtility ();
    21.      window.title = "Development Timer";
    22.    }
    23.  
    24.    void Update()
    25.    {
    26.      TimeSpan time = initTime.Add (TimeSpan.FromSeconds (EditorApplication.timeSinceStartup));
    27.      EditorPrefs.SetInt ("DevTime", (int)time.TotalSeconds);
    28.  
    29.      Repaint ();
    30.    }
    31.  
    32.    void OnGUI()
    33.    {
    34.      TimeSpan time = initTime.Add (TimeSpan.FromSeconds (EditorApplication.timeSinceStartup));
    35.  
    36.      GUILayout.Label (String.Format ("Time spent: {0}:{1}:{2}", time.Hours.ToString (), time.Minutes.ToString (), time.Seconds.ToString ()) , EditorStyles.whiteBoldLabel);
    37.    }
    38. }
    Editor script so make sure it's in the Editor folder. Also this is not really a very elegant solution :/
     
  9. darkhog

    darkhog

    Joined:
    Dec 4, 2012
    Posts:
    2,218
    Yeah, something like that.
     
  10. Divinux

    Divinux

    Joined:
    Jul 5, 2011
    Posts:
    205
    My buddies and I use ProcrastiTracker. It'll log your software usage with tons of details, so you can check how much time you spent surfing, in Unity, writing code on a per project basis, making assets and so on and so forth. Super useful.
     
  11. Ricachet

    Ricachet

    Joined:
    Jan 13, 2015
    Posts:
    6
    Awesome. Thanks for all the replies, man this forum is really active. I'm looking at RescueTime now. Also will look into ProcrastiTracker as well. Would be interesting to see a plug in for Unity.
     
  12. mdrotar

    mdrotar

    Joined:
    Aug 26, 2013
    Posts:
    377
    Be sure to check out ManicTime too which seemed popular in the thread I linked earlier. I use RescueTime though because it works on both Mac and Windows.
     
  13. iddqd

    iddqd

    Joined:
    Apr 14, 2012
    Posts:
    500
  14. Ox_

    Ox_

    Joined:
    Jun 9, 2013
    Posts:
    93
    I got tired from RescueTime sending all my usage history to their servers plus the weekly productivity email wasn't helpful since it was too late to get motivated.

    So we ended up creating our own time tracking app for macOS, Qbserve. There is no subscription, and all the tracked information is stored locally.

    It provides everything for seamless time tracking of work hours or freelance projects:
    – automatic productivity tracking for websites and apps
    – automatic project tracking based on opened documents and web pages
    – invoice generation
    – real-time performance feedback and notifications
    – various reports and timesheets
    – scheduled data export
    – Slack team and Skype chat tracking
    – many flexible settings to fit your needs

    Check this real-time productivity feedback:

    feedback-icons.gif

    dashboard-rounded.png
     
  15. SYNTYX

    SYNTYX

    Joined:
    Mar 14, 2020
    Posts:
    1