Dear Pals,

As I need to determine the speed of my win32 console application, can you
give me the API to find the system time in milliseconds. I have used
GetTickCount() and other multimedia timer function( with max resolution),
but it gives from application booting time, but I need to find from OS
booting time or system time.

Regards,
Shahul.

Re: How to find the system time in milliseconds??? by Christian

Christian
Fri Mar 10 01:01:20 CST 2006

shahul wrote:

> As I need to determine the speed of my win32 console application, can you
> give me the API to find the system time in milliseconds.

QueryPerformanceFrequency()-QueryPerformanceCounter()

Re: How to find the system time in milliseconds??? by Scherbina

Scherbina
Fri Mar 10 02:45:50 CST 2006

or rtdsc.

--
Vladimir
http://spaces.msn.com/vladimir-scherbina/

"Christian ASTOR" <castorix@club-internet.fr> wrote in message
news:On7QxBBRGHA.1096@TK2MSFTNGP11.phx.gbl...
> shahul wrote:
>
>> As I need to determine the speed of my win32 console application, can you
>> give me the API to find the system time in milliseconds.
>
> QueryPerformanceFrequency()-QueryPerformanceCounter()



Re: How to find the system time in milliseconds??? by Arkady

Arkady
Fri Mar 10 04:04:21 CST 2006

GetTickCount() return time from OS reboot but up to counter wrapping ( 49.7
days )
Arkady

"shahul" <shahul@chellasoft.com> wrote in message
news:%23pgMxwARGHA.1204@TK2MSFTNGP12.phx.gbl...
> Dear Pals,
>
> As I need to determine the speed of my win32 console application, can you
> give me the API to find the system time in milliseconds. I have used
> GetTickCount() and other multimedia timer function( with max resolution),
> but it gives from application booting time, but I need to find from OS
> booting time or system time.
>
> Regards,
> Shahul.
>



Re: How to find the system time in milliseconds??? by Gary

Gary
Fri Mar 10 04:00:23 CST 2006

RDTSC is in CPU cycles, not milliseconds and it maybe difficult or even
impossible (think of variable frequency clocks) to convert it to milliseconds.

--

-GJC [MS Windows SDK MVP]
-Software Consultant (Embedded systems and Real Time Controls)
- http://www.mvps.org/ArcaneIncantations/consulting.htm
-gchanson@mvps.org


"Scherbina Vladimir" <vladimir.scherbina@XgmailY.comZ> wrote in message
news:ObEZw6BRGHA.424@TK2MSFTNGP12.phx.gbl...
> or rtdsc.
>
> --
> Vladimir
> http://spaces.msn.com/vladimir-scherbina/
>
> "Christian ASTOR" <castorix@club-internet.fr> wrote in message
> news:On7QxBBRGHA.1096@TK2MSFTNGP11.phx.gbl...
> > shahul wrote:
> >
> >> As I need to determine the speed of my win32 console application, can you
> >> give me the API to find the system time in milliseconds.
> >
> > QueryPerformanceFrequency()-QueryPerformanceCounter()
>
>


Re: How to find the system time in milliseconds??? by shahul

shahul
Fri Mar 10 05:52:08 CST 2006

Thanks Arkady,

Is multimedia timer API "timeGetTime()" is also returns time from OS bootup.

Regards,
Shahul.


"Arkady Frenkel" <arkadyf@hotmailxdotx.com> wrote in message
news:%23FVhEnCRGHA.2176@TK2MSFTNGP10.phx.gbl...
> GetTickCount() return time from OS reboot but up to counter wrapping (
> 49.7 days )
> Arkady
>
> "shahul" <shahul@chellasoft.com> wrote in message
> news:%23pgMxwARGHA.1204@TK2MSFTNGP12.phx.gbl...
>> Dear Pals,
>>
>> As I need to determine the speed of my win32 console application, can you
>> give me the API to find the system time in milliseconds. I have used
>> GetTickCount() and other multimedia timer function( with max resolution),
>> but it gives from application booting time, but I need to find from OS
>> booting time or system time.
>>
>> Regards,
>> Shahul.
>>
>
>



Re: How to find the system time in milliseconds??? by Arkady

Arkady
Fri Mar 10 06:18:42 CST 2006

Yes
Arkady

"shahul" <shahul@chellasoft.com> wrote in message
news:uG4xSkDRGHA.5924@TK2MSFTNGP09.phx.gbl...
> Thanks Arkady,
>
> Is multimedia timer API "timeGetTime()" is also returns time from OS
> bootup.
>
> Regards,
> Shahul.
>
>
> "Arkady Frenkel" <arkadyf@hotmailxdotx.com> wrote in message
> news:%23FVhEnCRGHA.2176@TK2MSFTNGP10.phx.gbl...
>> GetTickCount() return time from OS reboot but up to counter wrapping (
>> 49.7 days )
>> Arkady
>>
>> "shahul" <shahul@chellasoft.com> wrote in message
>> news:%23pgMxwARGHA.1204@TK2MSFTNGP12.phx.gbl...
>>> Dear Pals,
>>>
>>> As I need to determine the speed of my win32 console application, can
>>> you give me the API to find the system time in milliseconds. I have used
>>> GetTickCount() and other multimedia timer function( with max
>>> resolution), but it gives from application booting time, but I need to
>>> find from OS booting time or system time.
>>>
>>> Regards,
>>> Shahul.
>>>
>>
>>
>
>



Re: How to find the system time in milliseconds??? by Homer

Homer
Fri Mar 10 08:01:14 CST 2006

> As I need to determine the speed of my win32 console application, can you
> give me the API to find the system time in milliseconds.

Maybe it's just me, but before you go looking for any API, can you first
elaborate on "system time in milliseconds"?

If it's 9:00am on Friday, March 10th 2006, how do you want this represented
in milliseconds?



Re: How to find the system time in milliseconds??? by Scherbina

Scherbina
Fri Mar 10 09:02:52 CST 2006

Gary, if you know clock frequency then having number of clocks you can
calculate time

--
Vladimir
http://spaces.msn.com/vladimir-scherbina/

"Gary Chanson" <gjchanson@_NO_SPAM_comcast.net> wrote in message
news:e$vLpnCRGHA.2436@TK2MSFTNGP11.phx.gbl...
> RDTSC is in CPU cycles, not milliseconds and it maybe difficult or even
> impossible (think of variable frequency clocks) to convert it to
> milliseconds.
>
> --
>
> -GJC [MS Windows SDK MVP]
> -Software Consultant (Embedded systems and Real Time Controls)
> - http://www.mvps.org/ArcaneIncantations/consulting.htm
> -gchanson@mvps.org
>
>
> "Scherbina Vladimir" <vladimir.scherbina@XgmailY.comZ> wrote in message
> news:ObEZw6BRGHA.424@TK2MSFTNGP12.phx.gbl...
>> or rtdsc.
>>
>> --
>> Vladimir
>> http://spaces.msn.com/vladimir-scherbina/
>>
>> "Christian ASTOR" <castorix@club-internet.fr> wrote in message
>> news:On7QxBBRGHA.1096@TK2MSFTNGP11.phx.gbl...
>> > shahul wrote:
>> >
>> >> As I need to determine the speed of my win32 console application, can
>> >> you
>> >> give me the API to find the system time in milliseconds.
>> >
>> > QueryPerformanceFrequency()-QueryPerformanceCounter()
>>
>>
>



Re: How to find the system time in milliseconds??? by Alexander

Alexander
Fri Mar 10 10:18:44 CST 2006

If you just need to time your application, it doesn't matter when your
timing source starts, whether from the application start or the system
start.

"shahul" <shahul@chellasoft.com> wrote in message
news:%23pgMxwARGHA.1204@TK2MSFTNGP12.phx.gbl...
> Dear Pals,
>
> As I need to determine the speed of my win32 console application, can you
> give me the API to find the system time in milliseconds. I have used
> GetTickCount() and other multimedia timer function( with max resolution),
> but it gives from application booting time, but I need to find from OS
> booting time or system time.
>
> Regards,
> Shahul.
>



Re: How to find the system time in milliseconds??? by Tomas

Tomas
Fri Mar 10 11:49:56 CST 2006

Hello,

shahul napsal(a):
> As I need to determine the speed of my win32 console application, can y=
ou=20
> give me the API to find the system time in milliseconds. I have used=20

I use this:

#ifndef WIN32
# include <sys/time.h>
#else
# include <sys/types.h>
# include <sys/timeb.h>
#endif

typedef long long millitime_t;

millitime_t millitime()
{
#ifdef WIN32
struct _timeb tb;
_ftime(&tb);
return (millitime_t)tb.time * 1000 + tb.millitm;
#else
struct timeval tv;
if (gettimeofday(&tv, 0))
throw runtime_error("gettimeofday: " +=20
string(strerror(errno)));
return (millitime_t)tv.tv_sec * 1000 + tv.tv_usec / 1000;
#endif
}

I hope this helps.

--=20
=2E--------- Tom=E1=A8 Janou=A8ek a.k.a. Liskni_si ---------.
: NOMI team, developer, http://tomi.nomi.cz/ tomi@nomi.cz :
' JID:liskni_si@jabber.cz, ICQ#161807083, tel:+420608876277 '

Re: How to find the system time in milliseconds??? by Tony

Tony
Fri Mar 10 13:43:06 CST 2006


"Homer J. Simpson" <root@127.0.0.1> wrote in message
news:u72LbsERGHA.3192@TK2MSFTNGP09.phx.gbl...
> > As I need to determine the speed of my win32 console application, can
you
> > give me the API to find the system time in milliseconds.
>
> Maybe it's just me, but before you go looking for any API, can you first
> elaborate on "system time in milliseconds"?

No need, really. The system holds a record of date/time already, in that
format. (And a few others too, as I recall)

So, by calling the proper functions with properly collected data you will be
handed some result which you then can ask the system to translate back to
you in a format that is clear to us simple mortals.

It would be useless to try and understand it, it's quite simple really but
you wouldn't learn anything from the execise - you'd just want to know what
goes where.

>
> If it's 9:00am on Friday, March 10th 2006, how do you want this
represented
> in milliseconds?

You'd just type that date/time and feed it to some function and the system
can go to work. The reason why, escapes me at the moment. There are probably
several good reasons - one being precision, and another inertia of the mind,
perhaps.

Tony. . .




Re: How to find the system time in milliseconds??? by Tony

Tony
Fri Mar 10 13:45:20 CST 2006

This is quite true, but you would want to be sure that you are using
whatever in a consistent manner.

Tony. . .


"Alexander Grigoriev" <alegr@earthlink.net> wrote in message
news:eASHm5FRGHA.252@TK2MSFTNGP10.phx.gbl...
> If you just need to time your application, it doesn't matter when your
> timing source starts, whether from the application start or the system
> start.
>
> "shahul" <shahul@chellasoft.com> wrote in message
> news:%23pgMxwARGHA.1204@TK2MSFTNGP12.phx.gbl...
> > Dear Pals,
> >
> > As I need to determine the speed of my win32 console application, can
you
> > give me the API to find the system time in milliseconds. I have used
> > GetTickCount() and other multimedia timer function( with max
resolution),
> > but it gives from application booting time, but I need to find from OS
> > booting time or system time.
> >
> > Regards,
> > Shahul.
> >
>
>



Re: How to find the system time in milliseconds??? by Gary

Gary
Fri Mar 10 14:35:35 CST 2006

You can't know the frequency if it is changing.

--

-GJC [MS Windows SDK MVP]
-Software Consultant (Embedded systems and Real Time Controls)
- http://www.mvps.org/ArcaneIncantations/consulting.htm
-gchanson@mvps.org


"Scherbina Vladimir" <vladimir.scherbina@XgmailY.comZ> wrote in message
news:eDNFBOFRGHA.1576@tk2msftngp13.phx.gbl...
> Gary, if you know clock frequency then having number of clocks you can
> calculate time
>
> --
> Vladimir
> http://spaces.msn.com/vladimir-scherbina/
>
> "Gary Chanson" <gjchanson@_NO_SPAM_comcast.net> wrote in message
> news:e$vLpnCRGHA.2436@TK2MSFTNGP11.phx.gbl...
> > RDTSC is in CPU cycles, not milliseconds and it maybe difficult or even
> > impossible (think of variable frequency clocks) to convert it to
> > milliseconds.
> >
> > --
> >
> > -GJC [MS Windows SDK MVP]
> > -Software Consultant (Embedded systems and Real Time Controls)
> > - http://www.mvps.org/ArcaneIncantations/consulting.htm
> > -gchanson@mvps.org
> >
> >
> > "Scherbina Vladimir" <vladimir.scherbina@XgmailY.comZ> wrote in message
> > news:ObEZw6BRGHA.424@TK2MSFTNGP12.phx.gbl...
> >> or rtdsc.
> >>
> >> --
> >> Vladimir
> >> http://spaces.msn.com/vladimir-scherbina/
> >>
> >> "Christian ASTOR" <castorix@club-internet.fr> wrote in message
> >> news:On7QxBBRGHA.1096@TK2MSFTNGP11.phx.gbl...
> >> > shahul wrote:
> >> >
> >> >> As I need to determine the speed of my win32 console application, can
> >> >> you
> >> >> give me the API to find the system time in milliseconds.
> >> >
> >> > QueryPerformanceFrequency()-QueryPerformanceCounter()
> >>
> >>
> >
>
>