Difference between revisions of "CodeProfiling"
(14 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | |||
− | |||
− | |||
__TOC__ | __TOC__ | ||
===Code Profiling Introduction=== | ===Code Profiling Introduction=== | ||
− | Code profiling is a tool for identifying bugs within code and also alerting programmers of redundant code. | + | Code profiling is a tool for identifying bugs within code and also alerting programmers of redundant code during simulation. Flowcode will highlight any icons which are 'hit', the frequency at which they are hit, and also notify which icons have never been hit. |
===Activating Code Profiling=== | ===Activating Code Profiling=== | ||
− | Code profiling is activated from the top toolbar with the following icon File:CodeProfilingIcon.png Once activated, run the simulation as normal and you will see the glow appear around icons that have been hit. A cross will appear over any icons that have not been executed. | + | Code profiling is activated from the top toolbar with the following icon [[File:CodeProfilingIcon.png]] Once activated, run the simulation as normal and you will see the glow appear around icons that have been hit. A cross will appear over any icons that have not been executed. |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
+ | ===Using Code Profiling=== | ||
+ | Here we can see that the 'yes' branch of the switch statement has not been executed, and so the 'output 1 to B0' icon, has also not been executed. This could be due to a bug in the code, or as in this example, the switch simply hasn't been pressed yet. | ||
+ | [[File:CodeProfilingEx1a.png]] | ||
+ | Here we can see that the switch has been pressed now. We know this as the cross has disappeared, and the icon has turned blue. The blue is a visual representation of how frequently this icon has been executed. Red icons are hit every time, and the more blue they turn, the less frequently they are executed. | ||
− | + | [[File:CodeProfilingEx1b.png]] |
Latest revision as of 08:38, 2 July 2019
Code Profiling Introduction
Code profiling is a tool for identifying bugs within code and also alerting programmers of redundant code during simulation. Flowcode will highlight any icons which are 'hit', the frequency at which they are hit, and also notify which icons have never been hit.
Activating Code Profiling
Code profiling is activated from the top toolbar with the following icon Once activated, run the simulation as normal and you will see the glow appear around icons that have been hit. A cross will appear over any icons that have not been executed.
Using Code Profiling
Here we can see that the 'yes' branch of the switch statement has not been executed, and so the 'output 1 to B0' icon, has also not been executed. This could be due to a bug in the code, or as in this example, the switch simply hasn't been pressed yet.
Here we can see that the switch has been pressed now. We know this as the cross has disappeared, and the icon has turned blue. The blue is a visual representation of how frequently this icon has been executed. Red icons are hit every time, and the more blue they turn, the less frequently they are executed.