profiler

 element objects

Runs the MATLAB code execution time profiler when the element is running. This can be a useful debugging or assessment tool for all code running during this time, including other element type code. You can set MATLAB profiler options directly using the profile command before running the experiment.

The element writes profile results in a <cd>profile(<cd><cds>'info'<cds><cd>)<cd> struct to a .mat file after the trial. If the experiment halts on error, the element still writes profile results to the file up to that point. If the file already contains profile results, the element will append to them in a struct array, so you can use the same file for multiple profiler elements across trials in an experiment. If the file already exists at experiment start, it will be overwritten.

At least as of R2021a, you can input a saved profile info struct to the command profview to view it—type help profview at the MATLAB command line for usage but e.g. <cd>profview(0, <cd><infoStruct><cd>)<cd>.

▸ Object ends on its own?

"Ends on its own" means ends automatically at that point. If an element can end on its own, you don't need to set end conditions for it in property end (unless you want it to maybe end earlier).

No—runs until any condition you set in property end.

Input properties
Record properties
profiler
elements (see below)

fileName

All visual elements
position

All adjuster elements have
adjust

All elements
start
end

startBuffer
endBuffer

vary
staircase

All objects
info
report

fileName

Default: profilerResults.mat

Name of .mat file to save or append results to. You can optionally include path. If you don't, it saves in the MATLAB current folder.

Adjustable properties

You can vary or allow the subject to adjust the following properties of an object of this type when it's running. If you need to make other properties adjustable, you can edit the element type code—see Element Type Programming Manual.

Adjustable properties

Adjustable properties

position
nn_eyes
rotation
colorMask
alpha
intensity
contrastMult
drawCodeVars

(None)

(None)

Input properties
Record properties

PsychBench uses record properties to record information during experiments. You can't set record properties but you can see them in experiment results using input property report.

profiler
elements (see below)

All elements
startTime
endTime
duration
n_startFrame
n_endFrame
startLatencyBufferable
endLatencyBufferable