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 2009-08-16 23:45

Lain.

Name: Anonymous 2010-12-23 10:10

Name: Anonymous 2011-02-04 11:54

Name: Sgt.Kabu꯽齔kiman놩쯭 2012-05-28 23:18

Bringing /prog/ back to its people
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy

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