Is there way to check when R session have been started ? In interactive mode
, not necessary in batch mode
.
It won't work on the current sessions, but may (locally) work on future sessions. Edit/create a .Rprofile
file in your home directory and add these two lines:
.startedTime<-Sys.time()
.sessionTime<-function() Sys.time()-.startedTime
The lines in .Rprofile
are executed at the beginning of the session. I choose names starting with a dot so they don't get returned by ls()
. Next, start an R session and when you give:
.sessionTime()
it will return the elapsed time from the beginning of the session.
The proc.time
function track times since R started (see help) which could be used as:
Sys.time() - proc.time()["elapsed"]
to find out when session started.
In windows you can try to see time of creation temp dir for r-session
file.info(tempdir())$ctime
Its only idea and may be not always work
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With