Solved

Get thread times under WIN95 ?

Posted on 1998-05-25
45
240 Views
Last Modified: 2013-12-29
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
0
Comment
Question by:rayofunreal
45 Comments
 
LVL 4

Expert Comment

by:dpavusin
ID: 1713524
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
 
LVL 1

Author Comment

by:rayofunreal
ID: 1713525
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
 
LVL 2

Expert Comment

by:tbaffy
ID: 1713526
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
 
LVL 1

Author Comment

by:rayofunreal
ID: 1713527
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
 
LVL 11

Expert Comment

by:mikeblas
ID: 1713528
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
 
LVL 1

Author Comment

by:rayofunreal
ID: 1713529
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
 
LVL 1

Author Comment

by:rayofunreal
ID: 1713530
WinTop used his own VxD....
0
 
LVL 1

Author Comment

by:rayofunreal
ID: 1713531
Adjusted points to 450
0
 
LVL 2

Expert Comment

by:RebosMan
ID: 1713532
Try posting this in the proper area ( Programming C++ ) and you might get better results ...
0
 
LVL 11

Expert Comment

by:mikeblas
ID: 1713533
Actually, the proper area would be the Windows programming area; this isn't a generic C++ question.

B ekiM
0
 
LVL 1

Author Comment

by:rayofunreal
ID: 1713534
Ok :-)
0
 
LVL 4

Expert Comment

by:dpavusin
ID: 1713535
I sent email to a good friend of mine and I belive he can help us... Waiting for reply..

Damir
0
 
LVL 1

Author Comment

by:rayofunreal
ID: 1713536
Thanx :-)
0
 
LVL 1

Author Comment

by:rayofunreal
ID: 1713537
Dear Damit, did you forgot ?
0
 
LVL 4

Expert Comment

by:dpavusin
ID: 1713538
Nope... still got no reply... I'll have to ask him again... he's busy man..

Damir
0
 
LVL 10

Expert Comment

by:rbr
ID: 1713539
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
 
LVL 1

Author Comment

by:rayofunreal
ID: 1713540
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
 
LVL 11

Expert Comment

by:alexo
ID: 1713541
Dear rbr, locking a question without providing an answer is not considered professional behavior.
0
 
LVL 1

Author Comment

by:rayofunreal
ID: 1713542
:-)

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
 
LVL 11

Expert Comment

by:alexo
ID: 1713543
You'll need a device driver to accomplish the functionality of GetThreadTimes under Win95.

See:
  http://www.dejanews.com/getdoc.xp?AN=227104610
0
 
LVL 1

Author Comment

by:rayofunreal
ID: 1713544
I know, but there are some progs, which can do it WITHOUT VxD (Pulse,ModPlug,Mod4Win).....
0
 
LVL 11

Expert Comment

by:alexo
ID: 1713545
Why don't you email the authors of such programs?
0
Don't lose your head updating email signatures!

Do your end users still have the wrong email signature? Do email signature updates bore you or fill you with a sense of dread? You can make this a whole lot easier on yourself by trusting an Exclaimer email signature management solution. Over 50 million users do...so should you!

 
LVL 1

Author Comment

by:rayofunreal
ID: 1713546
They (Edited by Computer101) me.... :-)
0
 
LVL 1

Author Comment

by:rayofunreal
ID: 1713547
Sorry, I forgot on me ?
0
 
LVL 1

Expert Comment

by:aquar
ID: 1713548
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
 

Expert Comment

by:jeseem
ID: 1713549
try suing performance data helper(pdh).see vc help.
0
 
LVL 1

Author Comment

by:rayofunreal
ID: 1713550
I tried... There is only sentense like this: Windows 95 did't sotring threads time... :-(
0
 
LVL 2

Expert Comment

by:chris_a
ID: 1713551
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
 
LVL 14

Expert Comment

by:smeebud
ID: 1713552
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
 
LVL 14

Expert Comment

by:smeebud
ID: 1713553
Damir,
are you getting my email messages??

Bud
0
 
LVL 4

Expert Comment

by:dpavusin
ID: 1713554
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
 
LVL 4

Expert Comment

by:dpavusin
ID: 1713555
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
 
LVL 4

Expert Comment

by:dpavusin
ID: 1713556
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
 
LVL 1

Author Comment

by:rayofunreal
ID: 1713557
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
 

Expert Comment

by:ewilson
ID: 1713558
have you tried microsoft kerneltoys, or powertoys... been awhile but i seem to remember the kernaltoys having features along this line...
0
 
LVL 1

Author Comment

by:rayofunreal
ID: 1713559
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
 
LVL 4

Expert Comment

by:agreen
ID: 1713560
Please unlock this question :)
0
 
LVL 4

Expert Comment

by:agreen
ID: 1713561
Please unlock this question :)
0
 
LVL 4

Expert Comment

by:dpavusin
ID: 1713562
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
 
LVL 1

Author Comment

by:rayofunreal
ID: 1713563
Sorry... When you'll get it from yours Russian friend, I'll give my pts to you...

   and Thanx !
0
 
LVL 4

Accepted Solution

by:
agreen earned 650 total points
ID: 1713564
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
 
LVL 4

Expert Comment

by:agreen
ID: 1713565
You can find the "Win32 Multithreading Performance" article there: http://premium.microsoft.com/msdn/library/techart/msdn_threadli.htm
0
 
LVL 4

Expert Comment

by:agreen
ID: 1713566
Hey, where are you ? :)
0
 
LVL 1

Author Comment

by:rayofunreal
ID: 1713567
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
 
LVL 1

Author Comment

by:rayofunreal
ID: 1713568
Thanx !!!!!!!!!!!!!!
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Storage devices are generally used to save the data or sometime transfer the data from one computer system to another system. However, sometimes user accidentally erased their important data from the Storage devices. Users have to know how data reco…
A Bare Metal Image backup allows for the restore of an entire system to a similar or dissimilar hardware. They are highly useful for migrations and disaster recovery. Bare Metal Image backups support Full and Incremental backups. Differential backup…
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now