Create timer for my vi

The portion of my project I'm currently working on requires to keep the time in between iteration of a for loop.
I want to be able to have a "time keeper" when I start the loop (in an event structure) to be shown in the front panel.
And also how do I get the "start time" of each iteration as there will be time delay ie wait time which is controlled by user assuming that there is no/negligible time in the processing?
And finally how do I make the event structure stop automatically after all the iterations are completed (for loop)?
Thank you.
Attached is the simplified vi.
Attachments:
Timer.jpg ‏45 KB

Hi,
First of all, replace the Wait function with a Wait until ms multiple function. This will give a more reproducible timing.
As to the event case ending after the iterations are done, I think this is automatically implied by your code. As soon as the code within the event case has executed, the event case is finished (unless it's in a loop, when it might be called again depending on user actions....).
You can also read out the current ms counter at the start of each loop to get the real loop start time if you want. Additionally, getting one at the end of the loop will enable you to find out approximately how long each loop takes. If this is close to, or more than your wait interval, you'll certainly have problems with your timing.
Hope this helps
Shane.
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)

Similar Messages

  • How create timer for game?

    I want to know how much time player spend in the game.
    For this i want create a timer.
    I thing it must be something like this:
    player come to the game (time 0:00), player plaing for example 22 minutes, gameover game (player spend 22 minutes and 0 sec).
    code:
    import flash.utils.getTimer;
    var gameStartTime:uint;
    var gameTime:uint;
    var gameTimeField:TextField;
    function mainFunction():void
         gameTimeField = new TextField();
         addChild(gameTimeField);
         gameStartTime=getTimer();
         gameTime=0;
         addEventListener(Event.ENTER_FRAME,showTime);
    function showTime(event:Event)
         gameTime=getTimer()-gameStartTime;
         gameTimeField.text="You plaing: "+clockTime(gameTime)+"min";
    function clockTime(ms:int)
         var seconds:int=Math.floor(ms/1000);
         var minutes:int=Math.floor(seconds/60);
         seconds-=minutes*60;
         var timeString:String=minutes+":"+String(seconds+100).substr(1,2);
         return timeString;
    mainFunction();
    Is this correct way?
    If you know how to make code smaller can you please share?
    Maybe exist standart component or something else for this?
    Thank you.

    Thank you guys!
    Just asking how to make timer correct:)
    I thout maybe you know existing standart coder or standart component for it?
    For example i use the same timer for 5 games.. and for every game i need create code..  Is it possible to make code just one time and create something like standart components in Flash IDE ? Or maybe adobe have place where everyone can create components and share whit other? Or its all not possible, and need create the same code again?
    By the way why i dont see my secons here?:
    var gameStartTime:uint;
    var gameTime:uint;
    function mainFunction():void
         gameStartTime=getTimer();
         gameTime=0;
         addEventListener(Event.ENTER_FRAME,showTime);
    function showTime(event:Event)
         gameTime=getTimer()-gameStartTime;
         myText.text="Time: "+clockTime(gameTime);
    function clockTime(ms:int)
         var seconds:int=Math.floor(ms/1000);
         var timeString:String=String(seconds+100).substr(1,2);
    mainFunction();

  • What is the Average video creating time for a 3min video on my Mac Air using iMovie?

    I have a MId 2013 MacBook Air and it is taking forever for iMovie to Process a 3 min video Vlog... Is this normal?
    Thank Guys

    Vlog??

  • PO created time(other then cdhdr or bdcpv or any change pointers)

    Hi,
    How to find the create time for the PO.
    Is it any way to find out without hitting the CDHDR(OBJECTID) or any change pointer tables..?
    Any help would be appreciated.
    Thanks in Advance,
    M-

    Which master data are you changing?
    FRE_ST_POINTER will not store changes for all the master data/transactional data. E.g. FRE_PO_POINTER stores changes to Purchase Orders only.

  • 'BAPI_GOODSMVT_CREATE' takes more time for creating material document

    Hi Experts,
    I m using 'BAPI_GOODSMVT_CREATE' in my custom report, it takes more time for creating Material documents.
    Please let me know if there is any option to overcome this issue.
    Thanks in advance
    Regards,
    Leo

    Hi,
    please check if some of following OSS notes are not valid for your problem:
    [Note 838036 - AFS: Performance issues during GR with ref. to PO|https://service.sap.com/sap/support/notes/838036]
    [Note 391142 - Performance: Goods receipt for inbound delivery|https://service.sap.com/sap/support/notes/391142]
    [Note 1414418 - Goods receipt for customer returns: Various corrections|https://service.sap.com/sap/support/notes/1414418]
    The other idea is not to commit each call, but executing commit of packages e.g. after 1000 BAPI calls.
    But otherwise, I am afraid you can not do a lot about performance of standard BAPI. Maybe there is some customer enhancement which is taking too long inside the BAPI, but this has to be analysed by you. To analyse performance, just execute your program via tr. SE30.
    Regards
    Adrian

  • 'BAPI_GOODSMVT_CREATE' takes more time for creating material document for the 1st time

    Hi Experts,
    I am doing goods movement using BAPI_GOODSMVT_CREATE in my custom code.
    Then there is some functional configuration such that, material documents and TR and TO are getting created.
    Now I need to get TO and TR numbers from LTAK table passing material documnt number and year, which I got from above used BAPI.
    The problem I am facing is very strange.
    Only for the 1st time, I am not finding TR and TO values in LTAK table. And subsequent runs I get entries in LTAK in there is a wait time of 5 seconds after bapi call.
    I have found 'BAPI_GOODSMVT_CREATE' takes more time for creating material document with similar issue, but no solution or explanation.
    Note 838036 says something similar, but it seems obsolete.
    Kindly share your expertise and opinions.
    Thanks,
    Anil

    Hi,
    please check if some of following OSS notes are not valid for your problem:
    [Note 838036 - AFS: Performance issues during GR with ref. to PO|https://service.sap.com/sap/support/notes/838036]
    [Note 391142 - Performance: Goods receipt for inbound delivery|https://service.sap.com/sap/support/notes/391142]
    [Note 1414418 - Goods receipt for customer returns: Various corrections|https://service.sap.com/sap/support/notes/1414418]
    The other idea is not to commit each call, but executing commit of packages e.g. after 1000 BAPI calls.
    But otherwise, I am afraid you can not do a lot about performance of standard BAPI. Maybe there is some customer enhancement which is taking too long inside the BAPI, but this has to be analysed by you. To analyse performance, just execute your program via tr. SE30.
    Regards
    Adrian

  • Creating sequences for all tables in the database at a time

    Hi ,
    I need to create sequences for all the tables in my database.
    i can create individually ,using toad and sqlplus.
    Can any one give me a code for creating the sequences dynamically at a time for all the tables.
    it is urgent ..
    Regards.

    I need to create sequences for majority of the tables that are having ID column
    which is sequences."The majority" is not the same as all. So you probably want to drive your generation script off the ALL_TAB_COLUMNS view...
    where column_name = 'ID'You need to think about this carefully. You might want different CACHE sizes or different INCREMENT BY clauses for certain tables. You might even (whisper it) want a sequence to be shared by more than one table.
    Code generation is a useful technique, but it is a rare application where one case fits all.
    Cheers, APC
    Blog : http://radiofreetooting.blogspot.com/

  • Create Adobe Form using Design Time for Processes and Forms

    Hi all,
    I am trying to create a form that have 3 fields:
    1. pernr
    2. ename
    3. effective_date
    I done all the necessary setup of BADI ,class, interface and form.
    I need the step to step guide where you create the adobe form using the Design Time for Processes and Forms. Anyone have any idea?
    Edited by: Siong Chao on Jan 3, 2011 4:54 AM
    Edited by: Siong Chao on Jan 3, 2011 5:00 AM

    Hi,
    I couldn't get to your query..
    What do you mean by step by step procedure for a design time & process for forms.
    if you are a beginner and looking for basic examples to implement adobe forms there are lot of them in SDN, please search them.
    let me know if your query was a very specific one.
    Cheers,
    Sai

  • When I change the time zone of the clock, the "Date created" time information for my documents and image files in the Finder window (and in Get Info) is changed. Can I make the time info in "Date created" remain fixed regardless of the clock's timezone?

    When I change the time zone of the clock, the "Date created" time information for my documents and image files in the Finder window (and in Get Info) is changed. Can I make the time info in "Date created" remain fixed regardless of the clock's timezone?

    When I change the time zone of the clock, the "Date created" time information for my documents and image files in the Finder window (and in Get Info) is changed. Can I make the time info in "Date created" remain fixed regardless of the clock's timezone?

  • I've exported a pdf document created in 2009 at least 20 times for a doc or docx version. Gibberish.

    I've exported a pdf document created in 2009 at least 20 times for a doc or docx version. Gibberish.

    Hi,
    Please open your PDF file in Adobe Reader then check the producer from File menu>Properties then let me know.I have seen the same issue with PDF file created by some producers.
    Or you can send me your PDF file so that I can look at it.
    Please use below site to share your file.
    https://adobeformscentral.com/?f=qJiclooYWGGNFtWfj8g3wg#
    Thank you.
    Hisami

  • Time for creating big arrays

    Hi,
    My program needed to create several arrays with big size and I found a interesting phenomenon:
    int capacityI=13000000;
    time1=System.currentTimeMillis();
    int[] v1=new int[13000000];
    time2=System.currentTimeMillis();
    int[] v2=new int[13000000];
    long time3=System.currentTimeMillis();
    int[] v3=new int[13000000];
    long time4=System.currentTimeMillis();
    int[] v4=new int[13000000];
    long time5=System.currentTimeMillis();
    int[] v5=new int[13000000];
    long time6=System.currentTimeMillis();
    System.out.println(time2-time1);
    System.out.println(time3-time2);
    System.out.println(time4-time3);
    System.out.println(time5-time4);
    System.out.println(time6-time5);And following is an output of the program:
    15
    16
    16
    5625
    16
    it took much more time to create the fourth array and I could not find the reason. My program is a big program, It did many things before the execution of the above code. Was it related to the garbage collector? I meant the java system ran the garbage collection program before the creation the the fourth array. Was I right?
    I want to prevent this problem, i.e., decrese the time for the creation of arrays. Is there any way?
    Thanks.

    Note that your snippet of test code doe snot require the 5 arrays to be in memory at the same time and is hence not representing your later stated requirement to have them all available.
    Your locally created v1 array is not referenced anymore after creation and therefore eligible for garbage collection, be aware of that. Setting good initial and maximum heap size values as suggested by others is of importance here.

  • Missed one letter at the time of creating account for icloud. how do i fix or create another email account?

    Missed one letter at the time of creating account for icloud. how do i fix or create another email account?

    Hi jtv123,
    Could you please tell us exactly what happens when you try to set up your account?
    With kind regards,
    David

  • Can I edit the start time for all the podcasts from a single subscription downloaded to my itunes? i.e. want to creat a playlist of all the podcasts I have from a particular show...

    I want to creat a playlist of all the podcasts I have from a particular show, want to edit out the first minute on all to skip the intro. Do not want to edit over 200 podcast manually. Is there a solution?

    View menu -> Show Status Bar
    Then the total play time for any group of tracks you select in the Songs area, for any selected album or for any selected playlist will show at the bottom of the iTunes window as in previous versions.
    The ability to open playlists in separate windows was for some unfathomable reason removed in iTunes 11. Whether it will ever come back none of us here can say, but you can express your need for that feature via Apple's feedback page:
    http://www.apple.com/feedback/itunesapp.html
    Regards.

  • Creating time source table for time dimension?

    hi exports
    can any one helps to create time source table or view_ for time dimension for awm_ mapping ?
    thanks
    Edited by: 1008794 on May 30, 2013 12:21 AM

    No. Thank you very much for reply.I have solved my problem
    Edited by: 1008794 on Jun 3, 2013 6:30 AM

  • Message Created time past the current time even accounting for set clock sk

    I'm getting the following when sending a message to a WebLogic 10.3 Web Service through OWSM security padding.
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
    <env:Header/>
    <env:Body>
    <env:Fault xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
    <faultcode>wsse:InvalidSecurityToken</faultcode>
    <faultstring>Security token failed to validate. weblogic.xml.crypto.wss.SecurityTokenValidateResult@39b53a[status: false][msg UNT Error:Message Created time past the current time even accounting for set clock skew]</faultstring>
    </env:Fault>
    </env:Body>
    </env:Envelope>
    On server side's TCP/IP Monitor I see the message received has <wsu:Created>2010-07-30T19:34:17Z</wsu:Created> in security header, the timestamp of TCP/IP Monitor showing time of request is 2010-07-30 12:32:51PM.
    Seems like the sender's clock is two minutes ahead of server.
    How do I adjust to lax the clock precision between client and server. Which side do I set the properties and what are the properties I need to set? Thanks

    Pam,
    from what i have gathered while trying to set mine up, the Time Capsule doesn't like other things broadcasting a wireless signal while it is trying to do the same... or at least, the other computers in the area can only recognize one at a time.
    So, in your case, you are using your MacBook Pro to wirelessly share the AirCard connection, right? If so, your computer is acting as a router, which means you have two devices trying to connect your computers to the same network wirelessly. I think this is why your computer isn't able to "see" your time capsule wirelessly. What i would recommend for you is to hook up your aircard to a computer that is not used very often, and (if it has a wireless adapter), turn the wireless adapter off. This way, you have only one device doing the wireless connecting (the Time Capsule in Bridge mode), which will direct internet traffic through ethernet to the connected computer.
    So, in conclusion, i just don't think it's possible to do what we want to do completely wirelessly.

Maybe you are looking for

  • Since upgrading to Mavericks, my system has slowed considerably.  Any suggestions?

    Hardware Information:           MacBook Pro (15-inch, Late 2008)           MacBook Pro - model: MacBookPro5,1           1 2.53 GHz Intel Core 2 Duo CPU: 2 cores           4 GB RAM Video Information:           NVIDIA GeForce 9400M - VRAM: 256 MB     

  • Exchange rate gain or loss in Payment proposal

    Hi, Is there a way where we can show the amount of exchange rate gain or loss realized on the detailed screen of the payment proposal.. Thanks,

  • Unable to create a photo calendar from iPhoto

    Hi, I'm trying to create a photo calendar for the first time and it just will not work for me. I've watched the tutorial and followed instructions but something is broken. I select an event with a dozen or so pictures, then hit the calendar button. T

  • Can i daisy chain external drives

    I have 3 drives but only 2 800 wire ports.  Can I daisy chain, or use a 400 wire?

  • Mini Windows 7 Starter won't restore!

    Hi, I have an HP mini netbook; Windows 7 starter. And I have a TON of viruses. And my computer won't even connect to the Wi-fi anymore even when I am right next to it! And frankly it's gotten annoying. I have tons of conduit viruses on this thing and