Accumulative time counter

Hi,
I am developing an online training web application in MVC framework,
i have to maintain a accumulated time counter for every user . for example 400 hrs a course means (00.00.00 to 200.35.45) (hr/minute/seconds) format .I will have to count for the entire session for every time user login.
first day: 00.00.00 to 02.35.45
second day :02.35.45 to 03.35.45
need solution.
Regards
gopi.

Convert to (milli)seconds and calculate it. There are no API's of use for you AFAIK.

Similar Messages

  • Solution for Accumulative time counter

    Hi,
    I am developing an online training web application in MVC framework,
    i have to maintain a accumulated time counter for every user . for example 400 hrs a course means (00.00.00 to 200.35.45) (hr/minute/seconds) format .I will have to count for the entire session for every time user login.
    first day: 00.00.00 to 02.35.45
    second day :02.35.45 to 03.35.45
    need solution.
    Regards
    gopi.

    Convert to (milli)seconds and calculate it. There are no API's of use for you AFAIK.

  • 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

  • How to add an "age / time counter" into DW?

    Can anyone assist on how to add an age / time counter into DW?
    In other words to say "Child X is now a years, b months old"? or "Product Z was launched A years B months ago"? Or, on the other hand, "You only have Z days & Y minutes left to enter"? With it updating in real time?
    Apologies in advance if this is a silly / obvious question but I just can't seem to do it!

    This isn't something you would add to DW, you would need to add it to your webpages. You would do this with javascript. Search the web for
    'javascript countdown timer' for plenty of examples.

  • I need to play back a video-recording i have taken myself and have it show the time count in seconds on the play back. Can you help?

    I need to play back a video-recording that I have taken myself and have it show the time counter in secs/minutes in the playback. Can anyone help?

    the movie editing app "Avid Studio" displays a time counter, as does the Pinnacle editing app.  Oddly enough, I movie does not.  (unless I have it somehow turned off.)

  • USB 8451 no timer / counter ?

    Hi all,
    i´m not sure if i´m in the right topic now, but i found no answer with the search function.
    I tried to generate an digital pulse using timer/counter functions with Labview 8.5 and an USB 8451, but it didn´t work.
    Is it possible that the USB 8451 doesn´t support timer / counter signals?
    Thanks for all your answer!

    Hi AK2DM,
    thanks for catching this one. I missed the important piece of information that the original poster would like to generate pulses. We have a KB-entry for this. You could also generate software-timed pulses with the 8451. The jitter (timing deviation), as you mentioned, could be a problem. The same issue arises with the 6501 I mentioned!
    For generating pulse trains I would recommend a basic E or M series device such as the 6210 USB.
    If you have further questions, don't hesitate to ask.
    Best regards,
    Peter
    Peter A.
    Field Sales Engineer, NI Germany

  • I always need to see the time counter on the music player, is that possible?

    As a spinning instructor I need to see the time counter on the music player all the time. Now it dissepears after a short time and I need to touch it to see it again and that is not good! I also wish that it was bigger numbers on the counter so I easy can see how long time it's lest on the songs.
    Ideas anyone?

    By default the screen display will dim in about 20 seconds to conserve the battery. And I cannot find any setting to inhibit this function. I am afraid there is no way you can keep the screen bright and enlarge the numbers on the timer.

  • Accumulative Distinct Counts

    I’ve been at this for two days now. Could someone lead me down the right path? Given the following data set:
    create table data_owner.test_data
    item_number varchar2(10 byte),
    store_number varchar2(10 byte),
    calendar_year varchar2(10 byte),
    calendar_week varchar2(10 byte),
    units_sold integer
    insert into test_data(item_number, store_number, calendar_year, calendar_week, units_sold)
    values ('1111', '31', '2010', '51', 4)
    insert into test_data(item_number, store_number, calendar_year, calendar_week, units_sold)
    values ('1111', '16', '2010', '51', 2)
    insert into test_data(item_number, store_number, calendar_year, calendar_week, units_sold)
    values ('1111', '31', '2010', '52', 3)
    insert into test_data(item_number, store_number, calendar_year, calendar_week, units_sold)
    values ('1111', '27', '2010', '52', 1)
    insert into test_data(item_number, store_number, calendar_year, calendar_week, units_sold)
    values ('1111', '16', '2011', '1', 3)
    insert into test_data(item_number, store_number, calendar_year, calendar_week, units_sold)
    values ('1111', '27', '2011', '2', 5)
    insert into test_data(item_number, store_number, calendar_year, calendar_week, units_sold)
    values ('1111', '20', '2011', '2', 4)
    insert into test_data(item_number, store_number, calendar_year, calendar_week, units_sold)
    values ('2222', '27', '2010', '51', 3)
    insert into test_data(item_number, store_number, calendar_year, calendar_week, units_sold)
    values ('2222', '16', '2010', '52', 2)
    insert into test_data(item_number, store_number, calendar_year, calendar_week, units_sold)
    values ('2222', '20', '2010', '52', 1)
    insert into test_data(item_number, store_number, calendar_year, calendar_week, units_sold)
    values ('2222', '16', '2011', '1', 3)
    insert into test_data(item_number, store_number, calendar_year, calendar_week, units_sold)
    values ('2222', '31', '2011', '2', 3)
    select * from test_data
    item_number     store_number     calendar_year     calendar_week     units_sold
    1111     31     2010     51     4
    1111     16     2010     51     2
    1111     31     2010     52     3
    1111     27     2010     52     1
    1111     16     2011     1     3
    1111     27     2011     2     5
    1111     20     2011     2     4
    2222     27     2010     51     3
    2222     16     2010     52     2
    2222     20     2010     52     1
    2222     16     2011     1     3
    2222     31     2011     2     3
    My desired result is a sum of units sold and an accumulative distinct count of store numbers grouped by item, year, and week. i.e.:
    item_number     calendar_year     calendar_week     store_count     sum(units_sold)
    1111     2010     51     2     6
    1111     2010     52     3     4
    1111     2011     1     3     3
    1111     2011     2     4     9
    2222     2010     51     1     3
    2222     2010     52     3     3
    2222     2011     1     3     3
    2222     2011     2     4     3
    I can’t seem to get the store count right. I’ve been trying various methods of the count(distinct store_number) over (…) analytic function, but nothing works. Thanks.

    Hi,
    Interesting problem!
    When using analytic functions, you can't use both DISTINCT and ORDER BY. Too bad; that sure would be convenient.
    The most general solution is to use aggregate functions instead of analytic functions, and do a self-join to pair every row ("table" l, for "later" in the query below) with every earleir row ("table" e below) for the same item:
    SELECT       l.item_number
    ,       l.calendar_year
    ,       l.calendar_week
    ,       COUNT (DISTINCT e.store_number)     AS store_count
    ,       SUM (l.units_sold)
         / COUNT (DISTINCT e.ROWID)          AS total_units_sold
    FROM       test_data   e
    JOIN       test_data   l      ON     e.item_number     = l.item_number
    AND                               e.calendar_year || LPAD (e.calendar_week, 2)
                                    <= l.calendar_year || LPAD (l.calendar_week, 2)
    GROUP BY  l.item_number
    ,       l.calendar_year
    ,       l.calendar_week
    ORDER BY  l.item_number
    ,       l.calendar_year
    ,       l.calendar_week
    ;You might think about storing a DATE (say, the date when the week begins) instead of year and week. It would simplify this query, and probably lots of other ones, too. I realize that might complicate some other queries, but I think you'll fiond a net gain.
    Thanks for posting the CREATE TABLE and INSERT statements; that helps a lot!
    Edited by: Frank Kulash on Nov 18, 2011 12:48 PM
    Here's an analytic solution. As you can see, it requires more code, and more complicated code, but it might perform better:
    WITH     got_r_num   AS
         SELECT     item_number
         ,     calendar_year
         ,     calendar_week
         ,     units_sold
         ,     ROW_NUMBER () OVER ( PARTITION BY  item_number
                                   ,                    store_number
                             ORDER BY        calendar_year
                             ,                calendar_week
                           )      AS r_num
         FROM    test_data
    SELECT DISTINCT
         item_number
    ,     calendar_year
    ,     calendar_week
    ,     COUNT ( CASE
                        WHEN  r_num = 1
                  THEN  1
                    END
               )             OVER ( PARTITION BY  item_number
                                      ORDER BY      calendar_year
                          ,          calendar_week
                                 )                    AS store_count
    ,       SUM (units_sold) OVER ( PARTITION BY  item_number
                                    ,             calendar_year
                          ,             calendar_week
                             )                         AS  total_units_sold
    FROM       got_r_num
    ORDER BY  item_number
    ,            calendar_year
    ,       calendar_week
    ;This approah will not work in all windowing situations. It's okay fo this job, but not if you wanted,for example, a count of distinct stores from the last 6 weeks, and the report covers more than 6 weeks.

  • Can you add a time counter

        I know you can view the project length in project info, but is there a way for the user to see a time count?
    Most viewers have this feature.
    Captivate 7

    It is a pretty old post, but still valid: http://blog.lilybiri.com/display-time-information

  • 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 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.

  • A time counter for the whole project

    Can you tell me is there any way to get the overall project time  as a time counter in the playback controls? Or viewed somewhere on Captivate?
    I need to know at which time a particular slide is appearing in a video. I can only find time duration  per slide or one overall time for the project.

    If you dont like the TOC, here you can find some other ideas:
    http://blog.lilybiri.com/display-time-information

  • How do I overlay a timer counting down on a Keynote slide?

    Hello!
    I am searching for a way (app or otherwise) to have a timer counting down while in "full screen" mode in Keynote. I am an urban educator, and I've found it very effective in having a stunning image on the smartboard via Keynote, in order to focus engagement while the students enter my classroom. I would love to also have a timer overlayed on that slide somewhere (right hand corner likely) counting down - so students know how much time they have to socilize and become situated before class "officially" begins.
    Appreciate any guidance!
    Best
    Biros

    My brain got fried with all of the previous SWFLoader positioning and centering - so much that I had to stop and clear my head and then this became an easy case of putting the HGroup and the Logo inside a BorderContainer.  I had inadvertently placed the Logo inside of HBox.

  • Insert time counter

    Hello,
    Is there a way to insert a time counter in a sequence? Is there any effect or plug in for this? An idea, any body??

    Piero, a regular poster to these boards, has free plugins in for both Timecode and Counter reader, they work quite well (tho so does the Timecode generator)
    http://web.mac.com/piero.fiorani/iWeb/PieroF%20FCE%20Effect/FCE%20Counter%20Disp lay.html

  • Time counter in iMove

    Hello there!
    I just imported a 1-hour video in iMovie which I want to extract a number of clips from. I've written on paper what times these clips take place (ex. 14:30 to 14:55). Now that I have the big 1-hour movie in the Event Browser, I can't seem to be able to see what time it is when I put down the mouse arrow. I can skim the various parts of the movie in the Event Browser by just passing the arrow above it, but how do I know where into the movie I am (timewise)? I can't see a time counter anywhere, not in the Event Browser, OR in the Project Window.
    Could it be possible that Apple left such an essential tool out?? I'd rather think I didn't abilitate it or something...
    Thanks for any help you can provide!!
    Z
    Message was edited by: zurdyo
    Message was edited by: zurdyo

    Was there ever an answer given to how one can see on the edited version of the iMovie the amount of time you are into the program? If you want to mix music in Garage Band and then import into iMovie, you really need to know this. I just wondered if there was some info that may not have been passed along or if this question has everyone stumped.

Maybe you are looking for