what is better: simple singleton class or function with static variables?

General question... I am planning to make simple singleton (only one instance) class with two or tree class-variables and one public method only. What is better approach and why - to make such class or to use just regular function with two or three static variables?

Both work.

A Class is usually made if there are going to be many objects.

larryd: Both work. A Class is usually made if there are going to be many objects.

Got it, thank you. Do you know, how much extra memory object instance required is?

Look at the compile output at the bottom of the IDE to see the memory used values.

larryd: Look at the compile output at the bottom of the IDE to see the memory used values.

Are there any general rules? I do not want to do both to compare :-)

Compile time optimisation means that (in my very limited experience doing just that) there is little to no difference in file size of the final code, and the advantage can go either way.

wvmarle: Compile time optimisation means that (in my very limited experience doing just that) there is little to no difference in file size of the final code, and the advantage can go either way.

Ok, got it, thank you... Still thinking object instantiation must takes more ram, at least for object reference, comparing with just functions . If it seems to be not very different, i will use singleton object, preffere object-oriented approach.

If you get to the point where the difference in memory consumption is important, you will have bigger problems - don't worry about it.