  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  package org.mangui.hls.loader {
+    import flash.utils.getTimer;
     import org.mangui.hls.controller.AudioTrackController;
     import org.mangui.hls.controller.AutoLevelController;
     import org.mangui.hls.HLSSettings;

                // if key loading failed
                case  LOADING_KEY_IO_ERROR:
                    // compare current date and next retry date.
                    if (new Date().valueOf() >= _key_load_error_date) {
                        /* try to reload the key ...
                        calling _loadfragment will also reload key */
                        _loadfragment(_frag_current);


            // Calculate bandwidth
            var fragMetrics : FragmentMetrics = _frag_current.metrics;
            fragMetrics.parsing_end_time = getTimer();
            CONFIG::LOGGING {
                Log.debug("Total Process duration/length/bw:" + fragMetrics.processing_duration + "/" + fragMetrics.size + "/" + (fragMetrics.bandwidth / 1024).toFixed(0) + " kb/s");
            }
