Download Time Calculator Script

Download time calculator script will help you to calculate the download time of file, folder or images.It Calculates time required to download large files with different modem speeds.

Features

  • This javascript function will calculate the download time of file, folder or images.
  • You have to pass file size as argument to compute() function.
  • It returns the download time based on the bandwidth.
  • Just copy the code into your page and use it.

Preview

Input File Size H
It will take
If your modem is Hrs Min Sec

Downloads

Javascript


<!-- Script by hscripts.com -->
<style>
.heading{ font-size:14px; font-family: arial, verdana, san-serif;
font-weight: bold; color: black;}
.subheading{ font-size:13px; font-family: arial, verdana, san-serif;
color: black;}
</style>
<script type="text/javascript">
var speeds = new Array(new Array("9.6","9.6"),new Array("14.4","14.4"),new Array("19.2","19.2"),new Array("28.8","28.8"),new Array("33.6","33.6"),new Array("56","56"),new Array("Single Channel ISDN(64) ","64"),new Array("Dual Channel ISDN(128)","128"),new Array("ADSL(384)","384"),new Array("S-HDSL(768)","768"),new Array("CDSL(1024)","1024"));
function compute(fsize, scale)
{
var size = parseFloat(fsize.size.value);for (var i = 1; i < 12; i++){var time = size * scale * 8.192 / speeds[i - 1][1];var hours = Math.floor(time / 3600);var minutes = Math.floor((time % 3600) / 60);var seconds = Math.floor(time % 60);fsize[i + "hour"].value = hours;fsize[i + "minute"].value = minutes;fsize[i + "second"].value = seconds;}
}
</script>
<!-- Script by hscripts.com -->



HTML Code



<form>
<table border="4">
<tr bgcolor="#D3D3D3">
<td bgcolor="#D3D3D3">
<table><tr><td class=subheading>
Input File Size
<input type="text" name="size" size="5">
<input type="button" onClick="compute(this.form, 1)" value="KB">
<input type="button" onClick="compute(this.form, 1024)" value="MB">
</td>
<td colspan=2 class=heading><center>It will take</center>
<td align=right><a href="https://www.hscripts.com" style="color:#3D366F;text-decoration:none;font-size:13px;cursor:pointer">H</a></td>
</td>
</tr>
<tr bgcolor="D3D3D3">
<th class=heading>If your modem is</th>
<th class=heading>Hrs </th>
<th class=heading>Min</th>
<th class=heading>Sec</th>
</tr>
<script type="text/javascript">
for(var j=1 ;j<12;j++)
{
document.write("<tr class=subheading><td bgcolor='#fffffe'>"+speeds[j-1][0]+" Kb</td><td><input type='text' name='"+j+"hour' size='6'> </td><td><input type='text' name='"+j+"minute' size='6'> </td><td><input type='text' name='"+j+"second' size='6'></td></tr>");
}
</script>
</table>
</td></tr>
</table>
</form>

  • Release Date - 07-04-2008
  • Get free version without ©copyright link for just $10/-
  • For customization of this script or any script development, mail to support@hscripts.com

Usage

  • Here we have explained with a form
  • Creating the form
  • <input type="text" name="size" size="5">
    <input type="button" onClick="compute(this.form, 1)" value="KB">
    <input type="button" onClick="compute(this.form, 1024)" value="MB">
    <script type="text/javascript">
      for(var j=1 ;j<12;j++){
        document.write("<input type='text' name='"+j+"hour' size='6'>
        <input type='text' name='"+j+"minute' size='6'>
        <input type='text' name='"+j+"second' size='6'>");
       }
    </script>
    
  • Copy the code into your page.
  • When the button 'KB' or 'MB' is clicked, the file size is passed as an argument to the 'compute()' function in download time calculator to calculate the download time.
  • Download time required to download large files with different modem speed is calculated inside 'compute' function and the value is displayed in the table.

License

Related Scripts

Free Javascript Scripts


Ask Questions

Ask Question