Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

☆(´∀`)★Win32★(,,゚Д゚)☆

Name: Anonymous 2007-03-15 14:39 ID:GJc0/qHH

This Python code gets the memory usage for a given process:
[code]
    def memory_usage(self):
        """Returns the memory usage of the process specified in settings["Process"]"""
        path = win32pdh.MakeCounterPath( (None, "Process", self.settings["Process"], None, -1, "Private Bytes") )
       
        hq = win32pdh.OpenQuery()
        hc = win32pdh.AddCounter(hq, path)
       
        win32pdh.CollectQueryData(hq)
        type, val = win32pdh.GetFormattedCounterValue(hc, win32pdh.PDH_FMT_LONG)
        return val
[code]

Now I'd like to see someone do this nicer in [insert-your-language-of-choice-here]. Hah!

Name: Anonymous 2007-03-17 0:11 ID:80uJnrCw

>>25
>>29
YHBT

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List