In RStudio you can add a timestamp to your code by just typing ts
and then pressing Shift + Tab (is that officially documented somewhere?).
My comment on the timestamp format here was mostly tongue-in-cheek, but seriously
Tue Apr 24 10:40:55 2018 ------------------------------
is a pretty weird format.
I'd say something like
2018-04-24 10:40:55 Tue ------------------------------
would be much better. Or is there a particular reason for the format above?