Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Displaying Progress

Displaying Progress

Scheduled Pinned Locked Moved C#
helpdatabasequestion
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Rizwan Rathore
    wrote on last edited by
    #1

    I have developed a software that takes text documents as input and after performing a few steps it generates an inverted index....and it takes a little time to do so and i want to display a percentage progress as text label.....and i ve calculated the time taken by each step in this and then changed that time into to percentage and displayed it after the button click.....but the problem now is that when i change the input files this percentage starts to look stupid.....so i want to ask that how can i calculate the percentage wich will work for all inputs.......... Looking forward for help Regards,

    M 1 Reply Last reply
    0
    • R Rizwan Rathore

      I have developed a software that takes text documents as input and after performing a few steps it generates an inverted index....and it takes a little time to do so and i want to display a percentage progress as text label.....and i ve calculated the time taken by each step in this and then changed that time into to percentage and displayed it after the button click.....but the problem now is that when i change the input files this percentage starts to look stupid.....so i want to ask that how can i calculate the percentage wich will work for all inputs.......... Looking forward for help Regards,

      M Offline
      M Offline
      MohammadAmiry
      wrote on last edited by
      #2

      Okay That's for sure a bad idea to do the time calculation since for the same file, on different machines of different speeds or even in your own machine when it is busy, times may take shorter or longer.... The idea is simple: you should make get to know the size of the input file (in characters, bytes etc.) and then simply check where you are processisng now... For example if the file is 100 characters long, and you are now processing the 23rd character, you are at 23% of your process.... Hope this could give you the idea....

      R 1 Reply Last reply
      0
      • M MohammadAmiry

        Okay That's for sure a bad idea to do the time calculation since for the same file, on different machines of different speeds or even in your own machine when it is busy, times may take shorter or longer.... The idea is simple: you should make get to know the size of the input file (in characters, bytes etc.) and then simply check where you are processisng now... For example if the file is 100 characters long, and you are now processing the 23rd character, you are at 23% of your process.... Hope this could give you the idea....

        R Offline
        R Offline
        Rizwan Rathore
        wrote on last edited by
        #3

        Sir the real problem is that i m reading about 350 files and i m performing one step at a time ist i read all the files then in the next step i remove the white spaces from it in next step i remove some unecessaray words from this dataset and few more steps like that i m doing it this way that i ist checked the total execution time of the program then i checked that how much time each of these steps take and then i divided that into percent of total time and then in each step i checked on the basis of all the files present and the file already processed......i hope u understand the problem now :) looking forward for help Regards,

        L 1 Reply Last reply
        0
        • R Rizwan Rathore

          Sir the real problem is that i m reading about 350 files and i m performing one step at a time ist i read all the files then in the next step i remove the white spaces from it in next step i remove some unecessaray words from this dataset and few more steps like that i m doing it this way that i ist checked the total execution time of the program then i checked that how much time each of these steps take and then i divided that into percent of total time and then in each step i checked on the basis of all the files present and the file already processed......i hope u understand the problem now :) looking forward for help Regards,

          L Offline
          L Offline
          Limey420
          wrote on last edited by
          #4

          Are you saying that you are looping through the files for EACH step? If so you are probably executing more loops which in itself will slow down. Prev poster is correct though, you CANNOT make a decision based upon time of execution, it just won't work for every (many) circumstances. BTW, I'm still unclear of what you're really trying to do!

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups