Arduino custom function before setup

I have some code that creates a function right before my set up code. And my question is will this function execute if I don't call it during my setup or loop function? I don't want it to execute at the beginning of my code but I need to define it somewhere.

void customfunction() {
//execute
}
void setup() {
//mysetup
}
void loop() {
//continuous looping
}

You define the order functions are called, apart from setup and loop

Yes, consider (untested, but)

void loop() {
//continuous looping
}
void setup() {
//mysetup
}

Would work perfectly well. The order doesn't matter. Setup will still run first because that is how it is defined in the core.

So are you guys saying the custom function would be executed or just defined when I place it at the top? I am hoping to call it in the void loop section with customfunction() but just define it at the top of the code.

Study C.
It is only executed when you call it, e.g.

...
customfunction();
...

meaningless term... loop() is a function that returns a void parameter.

If your function() is never referenced in the ‘active’ code, there’s a high likelihood the compiler/linker will optimise it into obloivion. - unless you tag it to force persistence.

I think you are confused because you see loop and setup defined and magically execute so you think defining another function is going to magically execute it too. loop and setup both are called from the code you don’t see from ‘int main’, the entry point if the c++ program. so no, unless you explicitly call your function, it won’t run, or even exist in compiled code.