Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: A TBEM stess experiment

  1. #1
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10

    A TBEM stess experiment

    Michael,

    I was experimenting with TBEM module in order to stress it a bit
    I wanted to have different events fired at different time interval. See below example.
    [code=thinbasic]
    uses "TBEM"
    uses "Console"

    dim event000Sec as long
    dim event001Sec as long
    dim event005Sec as long
    dim event010Sec as long
    dim event050Sec as long
    dim event100Sec as long

    %evg_Timers = 1

    %evt_000Secs = 1
    %evt_001Secs = 2
    %evt_005Secs = 3
    %evt_010Secs = 4
    %evt_050Secs = 5
    %evt_100Secs = 6


    function Event_Print_000Secs()
    Console_PrintAt("Timer occurs every 10 MilliSecs " & gettickcount, 1, 7, 9)
    end function

    function Event_Print_001Secs()
    Console_PrintAt("Timer occurs every 100 MilliSecs " & gettickcount, 5, 8, 9)
    end function

    function Event_Print_005Secs()
    Console_PrintAt("Timer occurs every 500 MilliSecs " & gettickcount, 10, 9, 10)
    end function

    function Event_Print_010Secs()
    Console_PrintAt("Timer occurs every 1 seconds " & time$ , 15, 10, 11)
    end function

    function Event_Print_050Secs()
    Console_PrintAt("Timer occurs every 5 seconds " & time$ , 20, 11, 12)
    end function

    function Event_Print_100Secs()
    Console_PrintAt("Timer occurs every 10 seconds " & time$ , 25, 12, 13)
    end function

    event000Sec = TBEM_AddEvent ("Event_Print_000Secs", %evt_000Secs, getTickcount, %evg_Timers, %TRUE)
    TBEM_SetRepeat (event000Sec, %TRUE , 10)
    'tbem_addtrigger (%evt_000Secs, %TRUE)

    event001Sec = TBEM_AddEvent ("Event_Print_001Secs", %evt_001Secs, getTickcount, %evg_Timers, %TRUE)
    TBEM_SetRepeat (event001Sec, %TRUE , 100)
    'tbem_addtrigger (%evt_001Secs, %TRUE)

    event005Sec = TBEM_AddEvent ("Event_Print_005Secs", %evt_005Secs, getTickcount, %evg_Timers, %TRUE)
    TBEM_SetRepeat (event005Sec, %TRUE , 500)
    tbem_addtrigger (%evt_005Secs, %TRUE)

    event010Sec = TBEM_AddEvent ("Event_Print_010Secs", %evt_010Secs, getTickcount, %evg_Timers, %TRUE)
    TBEM_SetRepeat (event010Sec, %TRUE , 1000)
    tbem_addtrigger (%evt_010Secs, %TRUE)

    event050Sec = TBEM_AddEvent ("Event_Print_050Secs", %evt_050Secs, getTickcount, %evg_Timers, %TRUE)
    TBEM_SetRepeat (event050Sec, %TRUE , 5000)
    tbem_addtrigger (%evt_050Secs, %TRUE)

    event100Sec = TBEM_AddEvent ("Event_Print_100Secs", %evt_100Secs, getTickcount, %evg_Timers, %TRUE)
    TBEM_SetRepeat (event100Sec, %TRUE , 10000)
    tbem_addtrigger(%evt_100Secs, %TRUE)

    while %TRUE
    TBEM_run(%evg_Timers)
    wend


    [/code]

    I have a problem and some questions.
    Problem:
    • if commented triggers are uncommented, nothing happened. Maybe I missed something


    Questions:
    • once event is created and active, do I also have to call tbem_addtrigger even if event has been set as active?
    • event type must be a unique number all around or unique inside a group? If event type is unique all around, why groups?
      I mean, can I have EventType 1 in 2 different groups? If yes, how can tbem_addtrigger knows what to trigger


    Sorry for "stressing" it/you

    Ciao
    Eros
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  2. #2
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10

    Re: A TBEM stess experiment

    Just further info.
    If you uncomment first 4 events (10 millisec, 100 millisec, 500 millisec, 1 sec) and comment last 2 all is working.
    If you uncomment also 5 sec event no events seem fired anymore other than the very first time.

    So it seems not related to the kind of events but maybe the number of them or at the complexity.

    Ciao
    Eros
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  3. #3
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10

    Re: A TBEM stess experiment

    Maybe problem is related to the number of events because I setup 5 events all to be fired every second and it dosen't work
    With 4 events it works
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  4. #4

    Re: A TBEM stess experiment

    Hi Eros,

    just saw this this morning and have to go to work now. I'll will check it tonight and let you know. Thanks for testing it.

  5. #5

    Re: A TBEM stress experiment

    Hi Eros,

    I hope I squished the bug. There where some time related problems with TBEM_Run. Let me know if it works ok now.

    Get the latest version from the usual place. And I'm sorry for the inconvenience this has caused.

    Michael

  6. #6
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732

    Re: A TBEM stess experiment

    Works great now,

    thanks a lot Mike for quick fix!


    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  7. #7

    Re: A TBEM stess experiment

    Quick???? At first I was pulling my hair out as I thought it was a problem with pointers. Well, it was a logic error. Hard to track but I think I got. But I won't say now that this module is bullet proofed.

  8. #8
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10

    Re: A TBEM stess experiment

    Thanks a lot Michael.
    Maybe I will "stress" it a little more later.

    Did you think about my previous questions?
    I really like this module so I want it clear in my mind! I see a lot of possible usages.

    Thanks a lot.
    Eros
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  9. #9

    Re: A TBEM stess experiment

    You mean the data trigger? You said forget about it. :P But I didn't. Let's discuss it in the topic you posted there first.

  10. #10
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10

    Re: A TBEM stess experiment

    No, I was referring to questions in first post here:
    Quote Originally Posted by ErosOlmi
    Questions:
    • once event is created and active, do I also have to call tbem_addtrigger even if event has been set as active?
    • event type must be a unique number all around or unique inside a group? If event type is unique all around, why groups?
      I mean, can I have EventType 1 in 2 different groups? If yes, how can tbem_addtrigger knows what to trigger
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

Page 1 of 2 12 LastLast

Similar Threads

  1. TBGL, TBEM
    By Petr Schreiber in forum Fixed or cleared errors in help material
    Replies: 2
    Last Post: 12-04-2008, 18:44

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

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