add function(times) to main.js

Again, I ask you for a check