GML How do I measure the process time a script took?

Discussion in 'Programming' started by Dawn, Jul 20, 2019.

  1. Dawn

    Dawn Member

    Joined:
    Sep 5, 2016
    Posts:
    58
    Do I need to get the time after the current step? Is there a way to get the time in a script or a script block?
     
  2. Annoyed Grunt

    Annoyed Grunt Member

    Joined:
    Jun 20, 2016
    Posts:
    136
    You can use get_timer() to get the time in microseconds. It is very much similar to current_time, which is however much less precise as it only returns the time in milliseconds.

    Code:
    var start_time = get_timer();
    your_script();
    var total_execution_time = get_timer() - start_time;
    
     
  3. Dawn

    Dawn Member

    Joined:
    Sep 5, 2016
    Posts:
    58
    Thanks for the answer
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice