User Tag List

Results 1 to 8 of 8

Thread: Stopwatch

  1. #1
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleiOS Export ModuleSWF Export Module
    Skyhunter's Avatar
    Join Date
    Jan 2007
    Location
    Croatia
    Posts
    451
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Stopwatch

    I am having a heavy loop that needs some optimization, it takes about a second or two to finish, and i would rather have it finish sooner, now the problem is not with that, but i would like a stopwatch to tell me how much time its actually needed to finish that loop. I tried with timer object and many time extensions but none did the trick, they all stop counting while the loop is going on... is there a stopwatch that could read time from windows time instead? I would like to know exactly how much time the loop takes so when i do changes to it to see which helps the most/least.

  2. #2
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleiOS Export ModuleSWF Export Module
    Skyhunter's Avatar
    Join Date
    Jan 2007
    Location
    Croatia
    Posts
    451
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Dude, no events outside the loop can fire until a loop is finished. Please dont post if you dont know...

  3. #3
    Clickteam Clickteam
    Danny's Avatar
    Join Date
    Aug 2007
    Location
    United Kingdom
    Posts
    2,998
    Mentioned
    19 Post(s)
    Tagged
    2 Thread(s)
    Peculiar scenario, looking at it I would do this:

    Objects
    List Object
    Date/Time
    2x Counter

    +Always: Add 1 to Counter 1
    +Always: Add Line to List "("Time:H:S:MS") - Value("Counter")"

    Then at your OnLoop conditions just add (at the start of the action list):
    +OnLoop: Add to 1 Counter 2
    +OnLoop: Add Line to List "("Time:H:S:MS") - Value("Counter 2")"

    This way you can compare in seconds and the current tick rate how much is 'usually' added to counter 1 on ALWAYS, then within the fastloop you will see what time(s)/how long the fastloop takes to execute by adding to counter 2. Ensure the events are at the start of the action list and not at the end.

  4. #4
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleiOS Export ModuleSWF Export Module
    Skyhunter's Avatar
    Join Date
    Jan 2007
    Location
    Croatia
    Posts
    451
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks, Danny, though i did find the Time X extension has GameStartedSince( "Time X" ) which works very nicely as a stopwatch and doesnt stop during a loop.

  5. #5
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleiOS Export ModuleSWF Export Module
    Skyhunter's Avatar
    Join Date
    Jan 2007
    Location
    Croatia
    Posts
    451
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well my issues have been answered, the Time X worked like a charm for me to figure out what was causing the most issues, and i have managed to reduce the loop from 1357 ms to 160 ms.

    And i have a top tip, selecting objects by comparing a string directly from string parser was my issue, its about 10 times faster if the string is loaded into another string first and then compared, which is kinda strange since its exactly the same expression and is still set within the same loop, but there you go.

  6. #6
    Clickteam Clickteam
    Danny's Avatar
    Join Date
    Aug 2007
    Location
    United Kingdom
    Posts
    2,998
    Mentioned
    19 Post(s)
    Tagged
    2 Thread(s)
    Skyhunter thanks for the heads up, I'm also very intrigued at how TimeX manages to tick even during a fastloop!

  7. #7
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleiOS Export ModuleSWF Export Module
    Skyhunter's Avatar
    Join Date
    Jan 2007
    Location
    Croatia
    Posts
    451
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No idea, it probably reads from windows time or something.

    Here example: https://dl.dropbox.com/u/14962632/Public1/LoopTime.mfa

  8. #8
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleXNA Export Module
    gkinfinity's Avatar
    Join Date
    May 2011
    Location
    USA
    Posts
    261
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the example. That's awesome

Similar Threads

  1. Need help creating a stopwatch!
    By eric1894 in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 6th October 2010, 10:33 AM
  2. Date & Time Stopwatch help
    By kungsangun in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 23rd June 2010, 10:28 PM
  3. Stopwatch and Fastloops
    By Tiles in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 26th January 2008, 04:54 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •