# Visual Basic > Visual Basic 6 and Earlier >  [RESOLVED] WMI ProcessorID too slow. Any other faster way ?

## some1uk03

Generally WMI returns results pretty fast, however, this processorID call, is takeing over 1000ms, slowing down the app.

Any alternative ideas to speed this up or another way of retrieving the CPU ID/SN ?




```
Debug.Print GetObject("winmgmts:\\.\root\cimv2:Win32_Processor='cpu0'").processorID
```

----------


## jdc2000

How often are you making that call in your program?

----------


## The trick

https://www.cyberforum.ru/post10062837.html *GetCPUIDInfo*

----------


## some1uk03

> How often are you making that call in your program?


Quite often, otherwise the 1sec isn't that bad, but when it's often the lag is a bit of a nuisance.






> https://www.cyberforum.ru/post10062837.html *GetCPUIDInfo*


Perfect!  What a difference!  Down to 157ms   :Smilie:

----------


## fafalone

Why wouldn't you cache the results? Not like the CPU is changing while your program is running.

----------


## VanGoghGaming

> Quite often, otherwise the 1sec isn't that bad, but when it's often the lag is a bit of a nuisance.)


If you would create a module level variable instead of calling "GetObject" every time then you would get the 1 sec delay only the first time you execute it and after that it will return the result instantly.



```
Dim objWMIServices As SWbemServices, objCPU As SWbemObject

Set objWMIServices = GetObject("winmgmts:")

For Each objCPU In objWMIServices.InstancesOf("Win32_Processor")
        Debug.Print objCPU.ProcessorID
        Exit For
Next objCPU
```

Add a reference to "Microsoft WMI Scripting V1.2 Library".

----------

