## Not run:
# times <- list(start=0, end=10)
# params <- list(dummy = 1)
# mySim <- simInit(times = times, params = params)
# if (require(archivist)) {
# archivist::createLocalRepo(paths(mySim)$cachePath)
# system.time(outSim <- cache(paths(mySim)$cachePath, spades, sim = mySim))
#
# # will be cached now, to be sure inputs are identical,
# # mySim should be put back to original state
# mySim <- simInit(times = times)
# system.time(outSim <- cache(paths(mySim)$cachePath, spades, sim = mySim))
# # compare
# system.time(outSim2 <- spades(mySim))
# }
# ## End(Not run)
Run the code above in your browser using DataLab