Time in milliseconds


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 11 of 11

Thread: Time in milliseconds

  1. #1
    martin Guest

    Time in milliseconds


    Hi,

    I need a function returning the time (system) in milliseconds. Can you help
    me???



  2. #2
    L.J. Johnson Guest

    Re: Time in milliseconds

    Martin,

    > I need a function returning the time (system) in milliseconds. Can you

    help
    > me???


    Try Karl Peterson's timer control at http://www.mvps.org/vb/index2.html (go
    to Controls, then pick either ccrpTmr or ccrpTmr6 (for VB 6.0). It's about
    as easy as you can get, widely used, and the price is right.

    --
    L.J. Johnson, Slightly Tilted Software
    Microsoft MVP (Visual Basic)
    LJJohnson@SlightlyTiltedSoftware.com or LJJohnson@mvps.org
    <http://www.SlightlyTiltedSoftware.com>
    Ask The NT Pro at <http://www.inquiry.com>




  3. #3
    L.J. Johnson Guest

    Re: Time in milliseconds

    Martin,

    > I need a function returning the time (system) in milliseconds. Can you

    help
    > me???


    Try Karl Peterson's timer control at http://www.mvps.org/vb/index2.html (go
    to Controls, then pick either ccrpTmr or ccrpTmr6 (for VB 6.0). It's about
    as easy as you can get, widely used, and the price is right.

    --
    L.J. Johnson, Slightly Tilted Software
    Microsoft MVP (Visual Basic)
    LJJohnson@SlightlyTiltedSoftware.com or LJJohnson@mvps.org
    <http://www.SlightlyTiltedSoftware.com>
    Ask The NT Pro at <http://www.inquiry.com>




  4. #4
    martin Guest

    Re: Time in milliseconds



    thanks


    "L.J. Johnson" <LJJohnson@SlightlyTiltedSoftware.com> wrote:
    >Martin,
    >
    >> I need a function returning the time (system) in milliseconds. Can you

    >help
    >> me???

    >
    >Try Karl Peterson's timer control at http://www.mvps.org/vb/index2.html

    (go
    >to Controls, then pick either ccrpTmr or ccrpTmr6 (for VB 6.0). It's about
    >as easy as you can get, widely used, and the price is right.
    >
    >--
    >L.J. Johnson, Slightly Tilted Software
    >Microsoft MVP (Visual Basic)
    >LJJohnson@SlightlyTiltedSoftware.com or LJJohnson@mvps.org
    ><http://www.SlightlyTiltedSoftware.com>
    >Ask The NT Pro at <http://www.inquiry.com>
    >
    >
    >



  5. #5
    martin Guest

    Re: Time in milliseconds



    thanks


    "L.J. Johnson" <LJJohnson@SlightlyTiltedSoftware.com> wrote:
    >Martin,
    >
    >> I need a function returning the time (system) in milliseconds. Can you

    >help
    >> me???

    >
    >Try Karl Peterson's timer control at http://www.mvps.org/vb/index2.html

    (go
    >to Controls, then pick either ccrpTmr or ccrpTmr6 (for VB 6.0). It's about
    >as easy as you can get, widely used, and the price is right.
    >
    >--
    >L.J. Johnson, Slightly Tilted Software
    >Microsoft MVP (Visual Basic)
    >LJJohnson@SlightlyTiltedSoftware.com or LJJohnson@mvps.org
    ><http://www.SlightlyTiltedSoftware.com>
    >Ask The NT Pro at <http://www.inquiry.com>
    >
    >
    >



  6. #6
    Cody Laird Guest

    Re: Time in milliseconds


    Try the following code:

    Private Type SMPTE
    hour As Byte
    min As Byte
    sec As Byte
    frame As Byte
    fps As Byte
    dummy As Byte
    pad(2) As Byte
    End Type

    Private Type MMTIME
    wType As Long
    units As Long
    smpteVal As SMPTE
    songPtrPos As Long
    End Type

    Private Declare Function timeGetSystemTime Lib "winmm.dll" (lpTime As MMTIME,
    ByVal uSize As Long) As Long

    Public Function GetCurrentTime() As Long
    Dim mmt As MMTIME

    On Error Resume Next

    ' return the current system time (in milliseconds)

    ' assign this value to wType field to
    ' specify time measurement in milliseconds
    mmt.wType = TIME_MS
    timeGetSystemTime mmt, LenB(mmt)
    GetCurrentTime = mmt.units
    End Function

    "martin" <martin@scg.ulaval.ca> wrote:
    >
    >
    >thanks
    >
    >
    >"L.J. Johnson" <LJJohnson@SlightlyTiltedSoftware.com> wrote:
    >>Martin,
    >>
    >>> I need a function returning the time (system) in milliseconds. Can you

    >>help
    >>> me???

    >>
    >>Try Karl Peterson's timer control at http://www.mvps.org/vb/index2.html

    >(go
    >>to Controls, then pick either ccrpTmr or ccrpTmr6 (for VB 6.0). It's about
    >>as easy as you can get, widely used, and the price is right.
    >>
    >>--
    >>L.J. Johnson, Slightly Tilted Software
    >>Microsoft MVP (Visual Basic)
    >>LJJohnson@SlightlyTiltedSoftware.com or LJJohnson@mvps.org
    >><http://www.SlightlyTiltedSoftware.com>
    >>Ask The NT Pro at <http://www.inquiry.com>
    >>
    >>
    >>

    >



  7. #7
    Cody Laird Guest

    Re: Time in milliseconds


    Try the following code:

    Private Type SMPTE
    hour As Byte
    min As Byte
    sec As Byte
    frame As Byte
    fps As Byte
    dummy As Byte
    pad(2) As Byte
    End Type

    Private Type MMTIME
    wType As Long
    units As Long
    smpteVal As SMPTE
    songPtrPos As Long
    End Type

    Private Declare Function timeGetSystemTime Lib "winmm.dll" (lpTime As MMTIME,
    ByVal uSize As Long) As Long

    Public Function GetCurrentTime() As Long
    Dim mmt As MMTIME

    On Error Resume Next

    ' return the current system time (in milliseconds)

    ' assign this value to wType field to
    ' specify time measurement in milliseconds
    mmt.wType = TIME_MS
    timeGetSystemTime mmt, LenB(mmt)
    GetCurrentTime = mmt.units
    End Function

    "martin" <martin@scg.ulaval.ca> wrote:
    >
    >
    >thanks
    >
    >
    >"L.J. Johnson" <LJJohnson@SlightlyTiltedSoftware.com> wrote:
    >>Martin,
    >>
    >>> I need a function returning the time (system) in milliseconds. Can you

    >>help
    >>> me???

    >>
    >>Try Karl Peterson's timer control at http://www.mvps.org/vb/index2.html

    >(go
    >>to Controls, then pick either ccrpTmr or ccrpTmr6 (for VB 6.0). It's about
    >>as easy as you can get, widely used, and the price is right.
    >>
    >>--
    >>L.J. Johnson, Slightly Tilted Software
    >>Microsoft MVP (Visual Basic)
    >>LJJohnson@SlightlyTiltedSoftware.com or LJJohnson@mvps.org
    >><http://www.SlightlyTiltedSoftware.com>
    >>Ask The NT Pro at <http://www.inquiry.com>
    >>
    >>
    >>

    >



  8. #8
    martin Guest

    Re: Time in milliseconds


    Thanks Cody,

    But what is the value for TIME_MS in function GetCurrentTime
    When i try this code i receive a compile error because this variable is not
    defined



    "Cody Laird" <cody.laird@suntrust.com> wrote:
    >
    >Try the following code:
    >
    >Private Type SMPTE
    > hour As Byte
    > min As Byte
    > sec As Byte
    > frame As Byte
    > fps As Byte
    > dummy As Byte
    > pad(2) As Byte
    >End Type
    >
    >Private Type MMTIME
    > wType As Long
    > units As Long
    > smpteVal As SMPTE
    > songPtrPos As Long
    >End Type
    >
    >Private Declare Function timeGetSystemTime Lib "winmm.dll" (lpTime As MMTIME,
    >ByVal uSize As Long) As Long
    >
    >Public Function GetCurrentTime() As Long
    > Dim mmt As MMTIME
    >
    > On Error Resume Next
    >
    > ' return the current system time (in milliseconds)
    >
    > ' assign this value to wType field to
    > ' specify time measurement in milliseconds
    > mmt.wType = TIME_MS
    > timeGetSystemTime mmt, LenB(mmt)
    > GetCurrentTime = mmt.units
    >End Function
    >
    >"martin" <martin@scg.ulaval.ca> wrote:
    >>
    >>
    >>thanks
    >>
    >>
    >>"L.J. Johnson" <LJJohnson@SlightlyTiltedSoftware.com> wrote:
    >>>Martin,
    >>>
    >>>> I need a function returning the time (system) in milliseconds. Can

    you
    >>>help
    >>>> me???
    >>>
    >>>Try Karl Peterson's timer control at http://www.mvps.org/vb/index2.html

    >>(go
    >>>to Controls, then pick either ccrpTmr or ccrpTmr6 (for VB 6.0). It's about
    >>>as easy as you can get, widely used, and the price is right.
    >>>
    >>>--
    >>>L.J. Johnson, Slightly Tilted Software
    >>>Microsoft MVP (Visual Basic)
    >>>LJJohnson@SlightlyTiltedSoftware.com or LJJohnson@mvps.org
    >>><http://www.SlightlyTiltedSoftware.com>
    >>>Ask The NT Pro at <http://www.inquiry.com>
    >>>
    >>>
    >>>

    >>

    >



  9. #9
    martin Guest

    Re: Time in milliseconds


    Thanks Cody,

    But what is the value for TIME_MS in function GetCurrentTime
    When i try this code i receive a compile error because this variable is not
    defined



    "Cody Laird" <cody.laird@suntrust.com> wrote:
    >
    >Try the following code:
    >
    >Private Type SMPTE
    > hour As Byte
    > min As Byte
    > sec As Byte
    > frame As Byte
    > fps As Byte
    > dummy As Byte
    > pad(2) As Byte
    >End Type
    >
    >Private Type MMTIME
    > wType As Long
    > units As Long
    > smpteVal As SMPTE
    > songPtrPos As Long
    >End Type
    >
    >Private Declare Function timeGetSystemTime Lib "winmm.dll" (lpTime As MMTIME,
    >ByVal uSize As Long) As Long
    >
    >Public Function GetCurrentTime() As Long
    > Dim mmt As MMTIME
    >
    > On Error Resume Next
    >
    > ' return the current system time (in milliseconds)
    >
    > ' assign this value to wType field to
    > ' specify time measurement in milliseconds
    > mmt.wType = TIME_MS
    > timeGetSystemTime mmt, LenB(mmt)
    > GetCurrentTime = mmt.units
    >End Function
    >
    >"martin" <martin@scg.ulaval.ca> wrote:
    >>
    >>
    >>thanks
    >>
    >>
    >>"L.J. Johnson" <LJJohnson@SlightlyTiltedSoftware.com> wrote:
    >>>Martin,
    >>>
    >>>> I need a function returning the time (system) in milliseconds. Can

    you
    >>>help
    >>>> me???
    >>>
    >>>Try Karl Peterson's timer control at http://www.mvps.org/vb/index2.html

    >>(go
    >>>to Controls, then pick either ccrpTmr or ccrpTmr6 (for VB 6.0). It's about
    >>>as easy as you can get, widely used, and the price is right.
    >>>
    >>>--
    >>>L.J. Johnson, Slightly Tilted Software
    >>>Microsoft MVP (Visual Basic)
    >>>LJJohnson@SlightlyTiltedSoftware.com or LJJohnson@mvps.org
    >>><http://www.SlightlyTiltedSoftware.com>
    >>>Ask The NT Pro at <http://www.inquiry.com>
    >>>
    >>>
    >>>

    >>

    >



  10. #10
    Cody Laird Guest

    Re: Time in milliseconds


    Sorry: (the old cut and paste gotcha!)

    Private Const TIME_MS as Long = 1

    Cody

    "martin" <martin.nadeau@scg.ulaval.ca> wrote:
    >
    >Thanks Cody,
    >
    >But what is the value for TIME_MS in function GetCurrentTime
    >When i try this code i receive a compile error because this variable is

    not
    >defined
    >
    >
    >
    >"Cody Laird" <cody.laird@suntrust.com> wrote:
    >>
    >>Try the following code:
    >>
    >>Private Type SMPTE
    >> hour As Byte
    >> min As Byte
    >> sec As Byte
    >> frame As Byte
    >> fps As Byte
    >> dummy As Byte
    >> pad(2) As Byte
    >>End Type
    >>
    >>Private Type MMTIME
    >> wType As Long
    >> units As Long
    >> smpteVal As SMPTE
    >> songPtrPos As Long
    >>End Type
    >>
    >>Private Declare Function timeGetSystemTime Lib "winmm.dll" (lpTime As MMTIME,
    >>ByVal uSize As Long) As Long
    >>
    >>Public Function GetCurrentTime() As Long
    >> Dim mmt As MMTIME
    >>
    >> On Error Resume Next
    >>
    >> ' return the current system time (in milliseconds)
    >>
    >> ' assign this value to wType field to
    >> ' specify time measurement in milliseconds
    >> mmt.wType = TIME_MS
    >> timeGetSystemTime mmt, LenB(mmt)
    >> GetCurrentTime = mmt.units
    >>End Function
    >>
    >>"martin" <martin@scg.ulaval.ca> wrote:
    >>>
    >>>
    >>>thanks
    >>>
    >>>
    >>>"L.J. Johnson" <LJJohnson@SlightlyTiltedSoftware.com> wrote:
    >>>>Martin,
    >>>>
    >>>>> I need a function returning the time (system) in milliseconds. Can

    >you
    >>>>help
    >>>>> me???
    >>>>
    >>>>Try Karl Peterson's timer control at http://www.mvps.org/vb/index2.html
    >>>(go
    >>>>to Controls, then pick either ccrpTmr or ccrpTmr6 (for VB 6.0). It's

    about
    >>>>as easy as you can get, widely used, and the price is right.
    >>>>
    >>>>--
    >>>>L.J. Johnson, Slightly Tilted Software
    >>>>Microsoft MVP (Visual Basic)
    >>>>LJJohnson@SlightlyTiltedSoftware.com or LJJohnson@mvps.org
    >>>><http://www.SlightlyTiltedSoftware.com>
    >>>>Ask The NT Pro at <http://www.inquiry.com>
    >>>>
    >>>>
    >>>>
    >>>

    >>

    >



  11. #11
    Cody Laird Guest

    Re: Time in milliseconds


    Sorry: (the old cut and paste gotcha!)

    Private Const TIME_MS as Long = 1

    Cody

    "martin" <martin.nadeau@scg.ulaval.ca> wrote:
    >
    >Thanks Cody,
    >
    >But what is the value for TIME_MS in function GetCurrentTime
    >When i try this code i receive a compile error because this variable is

    not
    >defined
    >
    >
    >
    >"Cody Laird" <cody.laird@suntrust.com> wrote:
    >>
    >>Try the following code:
    >>
    >>Private Type SMPTE
    >> hour As Byte
    >> min As Byte
    >> sec As Byte
    >> frame As Byte
    >> fps As Byte
    >> dummy As Byte
    >> pad(2) As Byte
    >>End Type
    >>
    >>Private Type MMTIME
    >> wType As Long
    >> units As Long
    >> smpteVal As SMPTE
    >> songPtrPos As Long
    >>End Type
    >>
    >>Private Declare Function timeGetSystemTime Lib "winmm.dll" (lpTime As MMTIME,
    >>ByVal uSize As Long) As Long
    >>
    >>Public Function GetCurrentTime() As Long
    >> Dim mmt As MMTIME
    >>
    >> On Error Resume Next
    >>
    >> ' return the current system time (in milliseconds)
    >>
    >> ' assign this value to wType field to
    >> ' specify time measurement in milliseconds
    >> mmt.wType = TIME_MS
    >> timeGetSystemTime mmt, LenB(mmt)
    >> GetCurrentTime = mmt.units
    >>End Function
    >>
    >>"martin" <martin@scg.ulaval.ca> wrote:
    >>>
    >>>
    >>>thanks
    >>>
    >>>
    >>>"L.J. Johnson" <LJJohnson@SlightlyTiltedSoftware.com> wrote:
    >>>>Martin,
    >>>>
    >>>>> I need a function returning the time (system) in milliseconds. Can

    >you
    >>>>help
    >>>>> me???
    >>>>
    >>>>Try Karl Peterson's timer control at http://www.mvps.org/vb/index2.html
    >>>(go
    >>>>to Controls, then pick either ccrpTmr or ccrpTmr6 (for VB 6.0). It's

    about
    >>>>as easy as you can get, widely used, and the price is right.
    >>>>
    >>>>--
    >>>>L.J. Johnson, Slightly Tilted Software
    >>>>Microsoft MVP (Visual Basic)
    >>>>LJJohnson@SlightlyTiltedSoftware.com or LJJohnson@mvps.org
    >>>><http://www.SlightlyTiltedSoftware.com>
    >>>>Ask The NT Pro at <http://www.inquiry.com>
    >>>>
    >>>>
    >>>>
    >>>

    >>

    >



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center