Get thread times under WIN95 ?

Hi there....

I need to know how % of power have each thread in my process. In WIN NT is function like GetThreadTimes, but under 95 it's not implemented. Please, I need it fast, I have no time for experiments... Can somebody helps me ? I'm using VC++ 5.0 without MFC....

              Thanx, Ray

ps:sorry for ugly english
LVL 1
rayofunrealAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

dpavusinCommented:
Install kernel toys from Microsoft and you'll see a tool named wintop. Start it and it will show nice process list with CPU times, durations etc. It is the same thing as the top command in UNIX.

Regards,

Damir
0
rayofunrealAuthor Commented:
Ops... Thanx... But I need to INCLUDE code in MY program.... I wont to do something like this:

CPU:40%

Understand ? Thanx :-))

   have a nice day,

                       Ray
0
tbaffyCommented:
Sorry, as far as I can tell there is no equivalent API function for Windows 95.  Every reference that I look in specify that the thread object and associated libary functions are for the most part WinNT only.

Tom
0
Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

rayofunrealAuthor Commented:
I know.... But WinTop CAN show CPU times, so THERE MUST BE some way.... But I have no time for it :-( I know that it is based in timers (?)....
0
mikeblasCommented:
It isn't based in timers.  It's information that's available only from kernel-level calls in Win95, and that means you need to use a device driver to get the information. (Examine WinTop more carefully, and you'll see that's what it's doing.)

.B ekiM

0
rayofunrealAuthor Commented:
Do you know which functions ? And which headers etc. ? I examine WinTop only for imported functions... I didn't find any which I don't know... :-(

   Thanx, Ray
0
rayofunrealAuthor Commented:
WinTop used his own VxD....
0
rayofunrealAuthor Commented:
Adjusted points to 450
0
RebosManCommented:
Try posting this in the proper area ( Programming C++ ) and you might get better results ...
0
mikeblasCommented:
Actually, the proper area would be the Windows programming area; this isn't a generic C++ question.

B ekiM
0
rayofunrealAuthor Commented:
Ok :-)
0
dpavusinCommented:
I sent email to a good friend of mine and I belive he can help us... Waiting for reply..

Damir
0
rayofunrealAuthor Commented:
Thanx :-)
0
rayofunrealAuthor Commented:
Dear Damit, did you forgot ?
0
dpavusinCommented:
Nope... still got no reply... I'll have to ask him again... he's busy man..

Damir
0
rbrCommented:
Can you pls tell me what you want to do. Is a simple profiling (which many compilers are able to do) enough for your problem.
0
rayofunrealAuthor Commented:
We're developing MOD/XM/IT/MPEG.... player, and I want to display how much percent of CPU time decoding have. Simple profiling (al thread in process, or single thread...).
 
  Thanx !
0
alexoCommented:
Dear rbr, locking a question without providing an answer is not considered professional behavior.
0
rayofunrealAuthor Commented:
:-)

I know, but I need answer... I really don't know how to do this under WIN95.... And I need it... :-(

  Thanx for helping !
0
alexoCommented:
You'll need a device driver to accomplish the functionality of GetThreadTimes under Win95.

See:
  http://www.dejanews.com/getdoc.xp?AN=227104610
0
rayofunrealAuthor Commented:
I know, but there are some progs, which can do it WITHOUT VxD (Pulse,ModPlug,Mod4Win).....
0
alexoCommented:
Why don't you email the authors of such programs?
0
rayofunrealAuthor Commented:
They (Edited by Computer101) me.... :-)
0
rayofunrealAuthor Commented:
Sorry, I forgot on me ?
0
aquarCommented:
The win95 system is not a multiprocess system.
The execute program is use by the win95 cpu for 100% process time.
If you want to know how many % time your program used.
You should close all other program and use the  system resorce table .
0
jeseemCommented:
try suing performance data helper(pdh).see vc help.
0
rayofunrealAuthor Commented:
I tried... There is only sentense like this: Windows 95 did't sotring threads time... :-(
0
chris_aCommented:
Do you need to find the individual load for each thread or the overall processor loading (like in system monitor). The overall loading is possible from VB, I have done it, for individual thread loading alla NT task manager I am not even sure the win95 kernel has this info.
0
smeebudCommented:
Ray, Download
DllShow.Zip
                         [File Dependencies, Printout and Excellent Resource Meter.]
See and download at http://www.execpc.com/~sbd/ OR http://www.execpc.com/~sbd/DLLShow.html 
DLL Show for Windows 95 is a small utility that displays a list of all tasks and processes currently
running on your MS Windows 95 system.
I like it better than Norton Utilities Resource meter.
It shows how much ram is used, when ram is used up it shows where your
swapfile takes over and how much free. and GDI.

lemme know what you think.

Bud
0
smeebudCommented:
Damir,
are you getting my email messages??

Bud
0
dpavusinCommented:
Received one so far Bud..

Damir

P.S. This problem seems more like programming section problem.. I hope guys over there know the solution.
0
dpavusinCommented:
I found something!

There was a mag article a year or two ago about a cycle counter for w95 called vcycle.vxd.
I think it was a Dr Dobbs Journal. I'm searching their source dbase right now. IF you wish you can try to locate it yourself (I hope I'll find it by tomorow)

http://www.ddj.com/ftp/

Search for vcycle or something simmilar..

There was a guy from Russia who said he'll send me his vxd only he had to solve few minor problems.. at least one will work..

Damir
0
dpavusinCommented:
My friend from Russia said he'll send me the vxd but you will need to figure out how to obtain
ring 0 thread handle - that's a difficult part...

BTW look at this:

From "Advanced Windows" (p81) by Jeffery Richter;

"Unfortunately, the GetThreadTimes and GetProcessTimes functions are not
functional in Microsoft Windows 95. If you call either of these functions in
Windows 95, they return FALSE. A subsequent call to GetLastError returns a
value of 120 (ERROR_CALL_NOT_IMPLEMENTED), which indicates that these
functions are only valid in Microsoft Windows NT."

"There is no reliable mechanism for an application to determine how much CPU
time a thread or process has used under Windows 95."

I hope we'll prove him wrong!

Damir
0
rayofunrealAuthor Commented:
Thanx ! I'll try it in this moment :-)

I have book from J.Richter.... But there must be some way... I finished some problems under W95, about them he wrote the same :-)
0
ewilsonCommented:
have you tried microsoft kerneltoys, or powertoys... been awhile but i seem to remember the kernaltoys having features along this line...
0
rayofunrealAuthor Commented:
Yes, ofcourse.... But WinTop uses his OWN VxD, and there is nothing about using it....

Dear dpavusin, I treyed it, but I didn't found it... can you help me ?


     Thanx !
0
agreenCommented:
Please unlock this question :)
0
agreenCommented:
Please unlock this question :)
0
dpavusinCommented:
I'm still looking for it..I tried to locate it but could not I sent them email asking for help in locating the source.. I think I'll have a vxd from my friend in Russia soon too so you can give it a shot if you figure out how to obtain ring 0 thread handle..

I'll try to find it again..I searched through 1997..it could be early 98 too..I'll look there too...

Damir
0
rayofunrealAuthor Commented:
Sorry... When you'll get it from yours Russian friend, I'll give my pts to you...

   and Thanx !
0
agreenCommented:
All that you need is to use two functions: QueryPerformanceCounter and QueryPerformanceFrequency. For additional information read this MSDN's "Win32 Multithreading Performance" article

There you can find a sample application.

By the way the right place for such kind of questions is Programming/Windows section :)
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
agreenCommented:
You can find the "Win32 Multithreading Performance" article there: http://premium.microsoft.com/msdn/library/techart/msdn_threadli.htm
0
agreenCommented:
Hey, where are you ? :)
0
rayofunrealAuthor Commented:
Sorry... I was on holidays... I'm here only for 1 day, I'll try it... sorry, holidays... I'll give you 650 pts...OK ? and sorry for waiting.... :-)
0
rayofunrealAuthor Commented:
Thanx !!!!!!!!!!!!!!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows OS

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.