R/bugsRunTime.R

Defines functions bugsRunTime

Documented in bugsRunTime

bugsRunTime <-
function(look.in=NULL){
   if(is.null(look.in))
      look.in <- c(tempdir(), getwd())
   for(dir in look.in)  {
      logtime <- file.info(file.path(dir, "log.txt"))$mtime
      if(!is.na(logtime)) break
   }
   if(!is.na(logtime)) {
      cat("WinBUGS run terminated at", strftime(logtime), "\n")
      runtime <- round(logtime - 
            file.info(file.path(dir, "script.txt"))$mtime, 2)
   } else {
      cat("'log.txt' and 'script.txt' not found.\n")
      runtime <- NA
   }
   return(runtime)
}
mikemeredith/MMmisc documentation built on Nov. 8, 2019, 11:34 p.m.