Added time function (plus some incremental progress elsewhere)
Merged conflicts