How to create a time counter

Hello expertsl,
I have a new challenge on board.
I have a form that is automatically popped up. Now on the form, i need to insert a timer that as soon as it pops out, the timer starts and then i have to enter some data in the form and as soon as i press the save button, the timer records the time count and then stores it in a table.
Any suggestion are the most welcome...
Thank you

As Hoek said, this is not a Forms forum.
However, the problem is not really unique to Forms and a timer itself is not needed.
A timer is a kernel object that fires at specific intervals and each time around executes a callback routine. This allows one to update or process at specific intervals.
You do not need a timer as you are interested in time elapsed - which means that on the creation of the form you need to get the current time. When the save button is clicked you again get the current time. The data that you are interested in is the time difference between these two.
Remember that timers are expensive objects to create ito kernel resources. Some operating systems limit the total number of timers that can be created. In general, it is not a good idea to create a timer unless it is the best technical solution for the problem. And you do not need a timer determine a time elapse. You simply need code in the constructor of the form and code in the save events of the form. Nothing more.

Similar Messages

  • How to create a time counter without using Sleep()?

    I want to create a time counter that would count from 120 minutes and down. I thought about using Sleep() but I have found out that Sleep() is not accurate (so maybe the countdown would take 122 minutes instead of 120 minutes!). What other alternatives do
    I have?
    Note that I want to count 1 second at a time, because I want to show the countdown progress to the user in seconds.

    The next experiment still uses Sleep and waits for approximately 12 seconds, displaying the time each second. However it is probably too overcomplicated compared to time polling:
    const
    int SECONDS_TO_WAIT =
    12;
    ULARGE_INTEGER ul_end;
    FILETIME ft;
    GetSystemTimeAsFileTime( &ft );
    ul_end.LowPart = ft.dwLowDateTime;
    ul_end.HighPart = ft.dwHighDateTime;
    ul_end.QuadPart += 10LL *
    1000 *
    1000 * SECONDS_TO_WAIT;
    for( ;; )
    FILETIME ft;
    GetSystemTimeAsFileTime( &ft );
    ULARGE_INTEGER ul;
    ul.LowPart = ft.dwLowDateTime;
    ul.HighPart = ft.dwHighDateTime;
    if( ul.QuadPart >= ul_end.QuadPart )
    break;
    SYSTEMTIME st;
    FileTimeToSystemTime( &ft, &st );
    Sleep( 1000 - st.wMilliseconds );
    GetSystemTime( &st );
    if( st.wMilliseconds >
    500 )
    FILETIME ft;
    SystemTimeToFileTime( &st, &ft );
    ULARGE_INTEGER ul;
    ul.LowPart = ft.dwLowDateTime;
    ul.HighPart = ft.dwHighDateTime;
    ul.QuadPart += 10LL *
    1000 *
    1000;
    ft.dwLowDateTime = ul.LowPart;
    ft.dwHighDateTime = ul.HighPart;
    FileTimeToSystemTime( &ft, &st );
    // show the time
    SystemTimeToTzSpecificLocalTime( NULL, &st, &st );
    printf( "%02i:%02i:%02i\n", st.wHour, st.wMinute, st.wSecond

  • [CS3 JS] How to Create a Timer?

    Within InDesign I need to be able to fire a periodic process to examine links from a JavaScript script. I have my own script running in its own engine.
    I can't figure out how to create a timer that will run in the background and call the appropriate callback function periodically.
    I've created a little process like this:
    * Sleeps for waitTime milliseconds then calls the callBack function.
    function timer(callBack, waitTime) {
    $.writeln("timer(): callBack=" + callBack + ", waitTime=" + waitTime);
    if (waitTime == undefined) waitTime = 2000;
    $.writeln("timer(): sleeping for " + waitTime + "...");
    $.sleep(waitTime);
    $.writeln("timer(): awake, calling callBack");
    try {
    return callBack();
    } catch (e) {
    $.writeln("timer(): Exception from callBack.exec(): " + e);
    return undefined;
    function myCallBack() {
    return Window.confirm("Callback called", true, "Continue looping");
    while (true) {
    if (!timer(myCallBack)) break;
    And this works in the sense that my timer runs, but it runs as a blocking process, which is not what I want.
    Is there something I'm missing or is this simply not possible in CS3 JavaScript? A search on "timer" in the InDesign forums didn't reveal anything, nor did the InDesign JavaScript Guide nor the Scripting Tools Guide.
    Thanks,
    Eliot

    1. Download and install Active Page Item Developer Toolkit.
    http://www.rorohiko.com/wordpress/indesign-downloads/active-page-item-developer/
    You'll have a demo period for 20 days or a month, I don't remember exactly.
    2. Create a new document, open 'Active Page Item Developer' panel (Windows menu).
    3. Copy the script from my previous post, draw an object - e.g. a rectangle and with the object selected enter 'idle' into Event Filter field, then press Tab and paste the script into the largest field.
    You'll see an alert appearing every 10 seconds and the cursor flickering.

  • How to create a Time Dimension

    Hi
    This is regarding a new topic which i could not find the answer in this forum.
    Actually i want to create a time dimension to populate my source data which is in date/time format.
    can anyone please reply back reagrding how to create a time dimension in ODI???
    regards
    Gourisankar

    Hi Gourisankar,
    I am not aware of time dimension. But when i searched in metalink i got the below note. I am not sure whether it will help you or not but still a small contribution. :)
    The note as follows,
    To create new time dimensions, run the following SQL instructions :
    * Example to generate a calendar between 1999-01-01 and 2007-12-31 one row per day
    SELECT to_date('1999-01-01','YYYY-MM-DD')+rownum
    FROM DUAL
    CONNECT BY
    ROWNUM<=to_date('2007-12-31','YYYY-MM-DD')-to_date('1999-01-01','YYYY- MM-DD');
    * Example for generating a calendar random number
    SELECT DBMS_RANDOM.VALUE
    FROM DUAL
    CONNECT BY ROWNUM<=1000000;
    May be you can create a VIEW out of this query ,reverse it and use that as a source in your interface.
    Try this and let me know.
    Thanks,
    G
    Edited by: Gurusank on Dec 22, 2008 4:19 PM

  • How to create countdown timer with sound

    Any ideas on how to create a minute and seconds countdown timer that would play a sound and then redirect you to another page?

    Hi,
    There is no out of the box solution to do so in Muse at the moment. If you can get your own code, you can add it to your site using "Insert HTML" feature.
    Regards,
    Aish

  • How to synchronize two timer/counter tasks?

    Hi,
    I'm programming DAQmx through the nicaiu.dll with Matlab. I'm trying to start two different tasks, each controlling ctr0 and ctr1, respectively. Both timer/counter tasks should start on a common trigger, in my case /Dev/PFI0. Having searched the forum, I do understand that both tasks can't be triggered off PFI0. Instead, I probably need to trigger one of my tasks on a signal that turns on whenever the first task starts. My question is; What signal can inform my ctr1 task that my ctr0 has started? I basically want these two tasks synchronized, but not pulse by pulse since the pulse trains are quite different.
    Trying to trigger both off PFI0 results in a resource conflict. Triggering ctr1 on ctr0gate doesnt work either.
    Also, I need ctr1 to trigger on when the ctr0 tasks starts, i.e. not when the first ctr0 pulse appaers!
    Thanks,
    Per

    Thanks Ryan.
    I made some changes to my code now and it appears I CAN trigger both counters off PFIO (on an E-Series board). I only recently converted all my Traditional code into DAQmx, and got lost in my tracks. I was trying to generate finite pulse trains on both counters, and had used Finite timing on the counters to generate finite retriggerable pulse trains, without knowing that tied up the second counter. I solved this now using Pause Triggers instead. In the case where I generate single retriggerable pulses I still use a Start Trigger, and I can now Start BOTH counters using DAQmxCfgDigEdgeStartTrig and listening to PFIO with both counters (each counter running off a separate task).
    Sorry, I got things confused, and your solution isnt required anymore. Similarly to your solution, though, I have always used a (real) analog output routed externally to the PFI0 pin on my E-Series board as the synchronizing trigger. However, if I could avoid the external wiring it would be nice, so I will explore your solution a bit more
    I am not familiar with the concept of a 'dummy' task/channel. Can you point me to more documentation on this?
    I already use the analog inputs on this board from another app. Will creating a dummy AI tie up all analog inputs, so I can't then access my physical analog inputs from other applications (on the same board)?
     - Per

  • How to create automatic timer process in BPM?

    Can anyone tell me how to create an automatic timer process in BPM?
    Can I just create an manual process, and drag the timer event into the swam lane, can connect the timer to the service and then to the end event?
    Thank you

    Hi,
    You can make use of Global Automatic activity to kick off your process at a particular time. Place a Global Automatic activity in your process and right click on the Global Automatic activity and select Properties --> General --> Global Automatic Type: Automatic Schedule, Automatic Schedule: <Configure with your requirement>.
    Else you can make use of due transition/timer activity to get your task done.
    Bibhu

  • How to create sharepoint timer job, which will run at farm level

    Hi ,
    I want to create SharePoint timer job which will access all site collections list from farm and give count of list items of each list and trigger email if count exceeded 4000 items.
    Thanks,
    Ganesh Pawar

    try these links:
    https://social.msdn.microsoft.com/Forums/en-US/75ccf7c0-13b2-4330-aaf2-355f107026a1/rest-services-error-are-a-specific-list?forum=sharepointcustomizationprevious
    https://social.msdn.microsoft.com/Forums/en-US/75ccf7c0-13b2-4330-aaf2-355f107026a1/rest-services-error-are-a-specific-list?forum=sharepointcustomizationprevious
    https://social.msdn.microsoft.com/Forums/en-US/75ccf7c0-13b2-4330-aaf2-355f107026a1/rest-services-error-are-a-specific-list?forum=sharepointcustomizationprevious
    https://social.msdn.microsoft.com/Forums/en-US/75ccf7c0-13b2-4330-aaf2-355f107026a1/rest-services-error-are-a-specific-list?forum=sharepointcustomizationprevious
    Please mark as answer if you find it useful else vote for it if it is close to answer..happy sharepointing

  • How to create real time chart with candle stick for displaying Open, High, Close, Low values from BSE/NSE EOD data

    Please help with sample windows form C#.Net Example

    Hi Goutam,
    Please refer to the following link with examples: http://www.codeproject.com/Questions/234865/create-real-time-chart
    Hope this helps you!
    Regards,
    Mitch!

  • How to create a time event without having user interface freeze

    Hi,
    I am new to labwindows and i am trying to create a time event where every hour for 24 hours i want my program to write somethign in excel. 
    I tried using function Delay and SyncWait and those functions freezes up the user interface.
    Any tips/help will be appreciated.
    Thank You
    Solved!
    Go to Solution.

    Many, if not most, CVI developers wind up implementing a delay function for themselves that periodically, during the delay, wakes up and processes events so that the GUI isn't frozen.
    The idea is to break the wait or delay up into pieces, and process system events in between each piece.
    A timer works too, you can try the async timer that Wolfgang mentioned, it runs a bit better and on a separate thread, so it lets you do what you normally would with the main thread and the GUI, yet still get timer function.   If you use a smart delay, you still wind up doing nothing a great deal of the time, and events are only processed periodically.

  • How to create a timer in forms with out using pjc

    Any body help me rgarding this matter..
    plez..

    That i know but how i assign this timer in an objects..like text bos or dispplay item????

  • How to create Measures for count on Flag colums in FACT with a CONDITON

    I have about 6 flag columns in my fact table and I would like to create measures in my report with count as aggregation on these flag columns with a group by on a condition.
    I am able to do this very easily with SQL query but am really stuck with on how to achieve this in OBIEE.
    Each of my measure should be to do an aggreagation of count on the flag column with a condition such as is flag true/false.
    Eg:
    Measure1 - Select count(INV_ID) from payments_f where Flag 1 = "TRUE" and Flag2 = "FALSE" GROUP_BY (COLUMN1)
    Measure2 - Select count(INV_ID) from payments_f where Flag 2 = "TRUE" and Flag3 = "FALSE" GROUP_BY (COLUMN1)
    similar conditions for all the flag columns.
    I tried to write the where condition in the Content tab of the Logical table but unfortunately it does on the table level - which was not very helpful to me
    I really appreciate if some one can help me on how to achieve this.
    Thanks in Advance

    You need to create a new logical column in your existing logical table. Then you need to set the physical mapping to:
    CASE WHEN FLAG1 = "TRUE" AND FLAG2 = "FALSE" THEN 1 ELSE 0 END.
    Set aggregation rule to Sum.
    Regards,
    Stijn

  • How to create Union Time Pool using accruals ???

    Hi,
    My client has a unique requirement of creating a Union Time Pool i.e. at the begining of each year the client will have 'X' amount of hours assigned to the pool. Employees under Union Contract will then be eligible to take any leave hours from that time pool as long as they are approved by there supervisor. Now, if we create an element pertaining to the special leave based on Time Pool, then an entry can be made at timecard level and the number of hours remaining can be determined.
    But, this pool is not employee based hence the Hours remaining calculation for the Time Pool is irrespective of any assignment rather its organization/GRE based. How do we implement this using Accruals?
    The client wants to view the balances in the Time Pool within the system. How can that be achieved?
    I understand Accruals Caculation and balances is totally assignment based, how can that be made for GRE/Organization based?
    Any help or suggestions will be highly appreciated.
    Thanks,
    Ujjal

    Hi,
    This is a really interesting scenario.. what are you trying to do
    1. Find a place where the common pool details can be entered at the start of the year
    2. The accrual process should deduct from this pool
    3. On accrual balance for the union should be displayed.
    let us evaluate what are things that cannot be used
    1. Elements can be initialized as the leave pool is for a group of people whereas elements are for an assignment
    2. Balances cannot be used for same reason
    so what are the options that we have..
    1. Store the pool in a lookup that can be created based on a bg or gre (use dff) and use the date fields of the lookup to simulate date track feature in HRMS. This way you would be able to enter values for every year for every bg / gre. Also enable another dff segment to store the balance leave in the pool. This field can be hidden.
    2. You can refer lookup in the accrual rules and evaluate the pool for processing the leave
    3. Customize the form / page to display the remaining pool from based on the person's detail and the lookup. This customization could be complicated instead you can maintain a dff in person/ asg table and write a custom process that will populate the pool balance for all people.
    This one of the suggestion I can give you.. there could be other options that you can evaluate.. but its not going to be simple..
    I hope this helps you.
    Regards,
    Vikash

  • How to create a time table by Automator

    I want to create a new calendar by using Automator. It is a time table.
    In the time table, there are Day 1 - Day 6.
    For example,
    https://files.me.com/lawhei/442uc1
    so on.
    It starts from 1/9/2010 and end on 1/7/2011.
    h represent holiday, no event needs to be created. The date of holiday is provided by the school.
    The problem that I am facing now is I can filter out the holiday but I don't know how to pass the dates to next action. The provided iCal actions are suck. How can I write my own action? Or do you guys have any suggestions for me to create such calendar?

    I just want to check I understand your issue.
    You have 1 WebI document which has 2 objects on it. One is a table and the other is a graph of the same values.
    You are linking to the graph using openDocument. However, you want to pass values from tableA (selected row values) into the graph.
    Is this correct?
    Regards
    Alan

  • How to create one time pop-up window?

    I'd like to have a pop-up window called "how to use this app" show up just one time; the first time a user opens the folio to read it for instruction but then not appear again after it is closed. How could I do this? Thanks.

    I have not tried the "alert-box technique" yet.
    I have found code that will only display for first time visitors. How would I add an image to the below code with a link to a website?
    newwin=open("yourpage.htm", "dispwin",
    "width=350,height=350,scrollbars=no,menubar=no");

Maybe you are looking for

  • Cannot open dashboard from connected client to restore a single file

    I have a small business network with an existing Server 2008 R2 domain controller.  In order to backup all the client machines with an experience something like windows home server I recently purchased a new server with windows server 2012 r2 and ins

  • Can't create computer account in Workgroup Manager

    Hi everybody !. I am installing a new Xserve with Mac OS X Server 10.5.6 and I am having some trouble with computer accounts in Workgroup Manager. I have a couple of PCs with Windows XP that I have added to the Windows domain created by Mac OS X Serv

  • Measure Aggregated at Logical Level causes poor performance

    OBIEE 11g We've recently implemented a new measure which involves aggregating a Period expenditure figure up to the Fiscal Year level. I've duplicated the existing Period_Expenditure rename to FY_Expenditure, and then changed the logical level for th

  • IPad 3 ios6 wifi issues help!

    I just updated to ios6 and now I can't connect to the Internet without getting being redirected to the apple site. HELP!

  • Performance implications of using multiple rules

    Hi: 1.  I have a question about the performance implications of multiple rules through a rule strategy sequence.  Can you share your experience on this? 2. Suppose that I have three rules that are accessed through a rule strategy sequence.  Would the