Results 1 to 5 of 5

Thread: GetTickCount

  1. #1

    GetTickCount

    Hi ,


    I wonder what is the type of the number returned by the GetTickCount function.

    long ? quad ? or other ?

    I think this info should be in help

    Best regards.

    Yann

  2. #2
    thinBasic MVPs ReneMiner's Avatar
    Join Date
    Oct 2012
    Location
    Germany
    Age
    51
    Posts
    1,418
    Blog Entries
    1
    Rep Power
    156
    you could find out using SizeOf( GetTickCount) - if 4 its a 32Bit integer, 8 were 64Bit Integer Type , 10 if it were a number or 16 in case Variant
    running thinBasic in HP Pavillon Desktop 590 a0xxx 8GB Ram AMD A6-9225 Radeon R4 5Compute Cores 2C+3G @2.6GHz

    OS: downgraded again to Windows 10 Enterprise x64 10.0.18363 Build 18363 (1909)
    (alternate OS: modified WinRE - boot from a fake ramdisk - currently in "reconstruction mode")

  3. #3

    not OK

    Hi René

    Sorry the SizeOf function does not work with FUNCTIONS but on VARIABLES or VARIABLES TYPE as documented in Sizeof manual page.

    So the topic still needs expert answer.

    Conversly the HiResTimer_Get help page is documented ( it's a QUAD)

    Regards

    Yann
    ThinBasic  v=1.11.1.0
    
    Last edited by Yann_F_29; 21-04-2021 at 18:39.

  4. #4
    Junior Member
    Join Date
    Dec 2020
    Location
    France
    Posts
    11
    Rep Power
    2
    Sorry it's a mistake
    I don't know how to delete a message.

    François
    Last edited by chameau; 21-04-2021 at 23:41. Reason: accident

  5. #5
    thinBasic MVPs ReneMiner's Avatar
    Join Date
    Oct 2012
    Location
    Germany
    Age
    51
    Posts
    1,418
    Blog Entries
    1
    Rep Power
    156
    [QUOTE=Yann_F_29;96013]Hi René

    Quote Originally Posted by Yann_F_29 View Post
    Hi René






    Sorry the SizeOf function does not work with FUNCTIONS but on VARIABLES or VARIABLES TYPE as documented in Sizeof manual page.






    So the topic still needs expert answer.

    Conversly the HiResTimer_Get help page is documented ( it's a QUAD)

    Regards

    Yann
    ThinBasic ;v=1.11.1.0
    

    you actually do not want to know the SizeOf(returned GetTickCount-result)


    but the TypeOf(result returned by GetTickCount)


    GetTickCount() is a Win32-API-Function. It returns a signed 32Bit integer (use Long or Int32 in thinBasic) which is the time in milliseconds since the computer powered up.
    It is known to be updated in a range bit above 20ms avarage and as precise as a bend ruler.
    It can respond maybe 50 times a second at most if windows is not busy that much...
    Can be you wait 3 seconds without any update of GetTickCount


    -while windows is busy contacting the microsoft-server to download some new malware-definitions or to upload your data for investigation-


    It serves to create a timer that tells you when the coffee maker is done and you can go to the kitchen and fetch some coffee or when the pizza in your oven is ready


    HiResTimer is something different, not based on the Win32-ticks


    it does not return 1 000 MILLIseconds per second but 1 000 000 MICROseconds and responds instantly while getTickCount has to wait until Windows message service has time to proceed your request.




    And Yes you are right sizeOf() will not return thesizeOf( a function )


    thats what anyone thinks who is used to compiled programming languages...
    how- were it the bytes of the functions body text to count?
    Before or after compilation?


    In compiled programming languages that will just say:


    ERROR - Type mismatch


    Some developers have the ugly habit to be very precise when returning a result and think about what the user might pass as a parameter besides the expected and develop dozens of new Error-message rather than to avoid any Errors i.e. when their developed function returns only what is commonly understood as the sizeof()-parameter must be a type or a variable and nothing else can be accepted.


    Sizeof() developed-with it a Bit of flexibility in mind inbetween the Bytes -


    when the passed parameter were no variable, no VarPtr and no Type -
    but a function, property or method or Function-Pointer
    - it will just result the size of the return type
    - or zero if it were a sub.




    The language reference also is not always up to date -what is not in help file might be developed already. Thinbasic is always good for a surprise - many times i wondered when it was so obvious that something should work a certain way and i found it did it already.


    Commonly new functions are tested in a Alpha- or Beta-Versions and sometimes need re-adjustment or changes in syntax or parameters so before they are not working and tested to be correct no one will announce it in help but ask in forum for testers...


    ...and when it comes to a release candidate --- who has time not only to develop and fix everything and not to forget any updates in the documentation while the users are staring onto their screens and wait the moment for the update or hotfix to be online...
    Last edited by ReneMiner; 23-04-2021 at 18:25.
    running thinBasic in HP Pavillon Desktop 590 a0xxx 8GB Ram AMD A6-9225 Radeon R4 5Compute Cores 2C+3G @2.6GHz

    OS: downgraded again to Windows 10 Enterprise x64 10.0.18363 Build 18363 (1909)
    (alternate OS: modified WinRE - boot from a fake ramdisk - currently in "reconstruction mode")

Similar Threads

  1. GetTickCount: More technical information will avoid confusion
    By Petr Schreiber in forum Fixed or cleared errors in help material
    Replies: 1
    Last Post: 27-02-2011, 12:22
  2. GetTickCount
    By zlatkoAB in forum General
    Replies: 4
    Last Post: 27-02-2011, 11:47

Posting Permissions

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