Using a variable will always be faster then doing a function call, however, in some cases, it wouldn't be very useful.
GraphicsWidth() probably won't change on you, and if it does you can update the Variable at that time.
Millsecs() changes every... oh, every 1/1000 of a second :-)
So you will probably need to keep calling that function.
If the value changes A LOT then you're better off calling the function. If the value rarely changes but you access it a lot, then you should use a variable. If the value rarely changes and you rarely access it, then you could do either one.
If the value changes a lot, but you need to have a value from a given point in time, then you will need to do both. Call the function, save it in a variable then use the variable.
You have to look at every situation and make the determination of what is best for your situation.
GraphicsWidth() probably won't change on you, and if it does you can update the Variable at that time.
Millsecs() changes every... oh, every 1/1000 of a second :-)
So you will probably need to keep calling that function.
If the value changes A LOT then you're better off calling the function. If the value rarely changes but you access it a lot, then you should use a variable. If the value rarely changes and you rarely access it, then you could do either one.
If the value changes a lot, but you need to have a value from a given point in time, then you will need to do both. Call the function, save it in a variable then use the variable.
You have to look at every situation and make the determination of what is best for your situation.