Hi,
Very often we tend to create several test versions of an Arduino project on our computer, without any version control.
It may become confusing after uploading to remember which version is currently running, especially if some time has passed since uploading.
For that, I use (and recommend) to add to any project setup() I make a header that automatically prints out on startup or reset the file name, date and time of saving.
The code is simple: (Can also use formatted printout sprintf or printf)
This prints the date & time it was compiled and uploaded, not saved.
If local saving I use a folder with the project name then the project name + Version number (This creates a folder with the same name containing the project file(s)), and have a text file in the main folder with notes of additions/tests/todo etc.
Yes, you are right, its the compilation time.
Adding a file to the project in its original folder is fine. The advantage of the code I added is in it being the last running version. I often have several files open, and not sure which one was loaded to the device. By pressing the reset key I get that information. It is also useful when the device is run on its final destination without the IDE or the source files, where any serial reader can show the version info.
I do something similar on every Arduino project. This way when I pick up a breadboard project that I want to resume working on, I don't have to search (guess) for the project files. Just plug in the USB, enable the console, then power or reset the board.