 			logger.warn {err, args}, "qpdf failed"
 			callback(null) # ignore the error
 		proc.on "close", (code) ->
+			timer.done()
 			if code != 0
 				logger.warn {code, args}, "qpdf returned error"
 				return callback(null) # ignore the error

		args = ["--linearize", src, tmpOutput]
		logger.log args: args, "running qpdf command"

		proc = spawn("qpdf", args)
		stdout = ""
		proc.stdout.on "data", (chunk) ->

Path = require "path"
spawn = require("child_process").spawn
logger = require "logger-sharelatex"
Metrics = require "./Metrics"
_ = require "underscore"

module.exports = OutputFileOptimiser =
