Any way to profile plugin code developed with RackAFX/VS Express? | Debugging in Visual Studio | Forum


Please consider registering

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —

— Match —

— Forum Options —

Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
Any way to profile plugin code developed with RackAFX/VS Express?
August 19, 2014 - 10:03 am
Member Since: February 26, 2014
Forum Posts: 11
sp_UserOfflineSmall Offline

Does anyone know of a way to run a profiler for plugin code developed with RackAFX/Visual Studio Express? I'd love to be able to have some kind of profiler functionality be able to analyze what in my code is taking the most time, etc. in order to help better understand and optimize what's going on.

Searching around online however indicates that Visual Studio Express doesn't provide this functionality. However, I'm wondering if anyone has figured out a way to do something like this in their setup?


August 26, 2014 - 6:34 pm
Member Since: January 29, 2017
Forum Posts: 693
sp_UserOfflineSmall Offline

Hi Michael

A very old trick for profiling operations uses a low level Windows function called GetTickCount(). It returns a DWORD that is the number of milliseconds that have elapsed since the computer was turned on (info here:

While the absolute resolution depends on the computer, you can use this to track down how much time a given loop, function call. etc... takes especially when the operation is very time intensive. To use it:

DWORD start = GetTickCount();

--- long, time intensive loops, function calls, etc here... ---

DWORD end = GetTickCount();

DWORD processTime = end - start;

The processTime is the number of milliseconds the operation required, so it only works for really time intensive operations. You can then use the RAFX built-in function uintToString() to convert it to a string and then write it to the RAFX Status window (see other reply to your other post).

You can also use this method to gauge which parts of your code are the time-intensive ones (where you are only looking at relative values and not the absolute milliseconds) by forming several sets of start/end timing combinations.

A few years ago, I had my students do a comparison of using the sin() function versus a wavetable lookup for CPU usage. They did loops of 250000 calls to sin() or the wavetable lookup and timed these ridiculously long loops with GetTickCount(). Outcome - on today's processors with very efficient math logic units, wavetable lookups are actually no faster then the sin() function call. In some cases, they are slower (!!).

- Will

September 6, 2014 - 7:55 pm
Member Since: February 26, 2014
Forum Posts: 11
sp_UserOfflineSmall Offline

Hi Will,

Thank you very much for your really useful suggestion on this (and sorry for the belated reply). I really appreciate it and have actually started using this.

In some related work, slightly unrelated to RackAFX, I had to do something similar but within the Mac environment. Perhaps outside the current scope of RackAFX and these Forums, but for anyone interested the corresponding function on the Mac would be mach_absolute_time() (declared in mach/mach_time.h) and you can get some details at

Thanks again!


Forum Timezone: America/New_York

Most Users Ever Online: 152

Currently Online:
4 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Chaes: 56

Skyler: 48

StevieD: 46

Derek: 46

Frodson: 45

Peter: 43

TheSmile: 43

Nickolai: 43

clau_ste: 39

jeanlecode: 37

Member Stats:

Guest Posters: 2

Members: 784

Moderators: 1

Admins: 6

Forum Stats:

Groups: 13

Forums: 42

Topics: 850

Posts: 3372

Moderators: W Pirkle: 693