Skip to content

Commit

Permalink
example : add timer
Browse files Browse the repository at this point in the history
  • Loading branch information
dduponchel committed Jan 1, 2013
1 parent 51efe30 commit 622da2e
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion examples/read-local-file-api.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,22 @@
// Closure to capture the file information.
reader.onload = (function(theFile) {
return function(e) {
$result.append("<h3>" + theFile.name + "</h3>");
var $title = $("<h3>", {
text : theFile.name
});
$result.append($title);
var $ul = $("<ul>");
try {

var dateBefore = new Date();
// read the content of the file with JSZip
var zip = new JSZip(e.target.result);
var dateAfter = new Date();

$title.append($("<span>", {
text:" (parsed in " + (dateAfter - dateBefore) + "ms)"
}));

// that, or a good ol' for(var entryName in zip.files)
$.each(zip.files, function (index, zipEntry) {
$ul.append("<li>" + zipEntry.name + "</li>");
Expand Down

0 comments on commit 622da2e

Please sign in to comment.