title: How to get the start time and end time of method in ASP.Net MVC?
body: <p>I have a method in my controller upload method which converts the uploaded image file into three different sizes. I want to dispaly the time taken from when the file is uploaded and and the end of the method the conversion stopped can any one tell me how can I do this</p>
  
  <pre><code>       this is my controller
  
  
             public ActionResult Upload()
      {
          //ViewBag.ProcessingTime = DateTime.Now;
          return View();
      }
  
          [HttpPost]
          public ActionResult Uploading(ImageModel model)
          {
              if (ModelState.IsValid)
              {
  
                  Console.WriteLine("time is"+System.DateTime.Now);
  
                  string fileName = Guid.NewGuid().ToString() + System.DateTime.Now.ToString("yyyy/MM/dd/hh/mm/ss/fff");
                  string serverPath = Server.MapPath("~");
                  string imagesPath = serverPath + "Content\\Images\\";
                  string thumsise = Path.Combine(imagesPath, "Thumb" + fileName);
                  string thumbPath = Path.Combine(imagesPath, "Thu" + fileName);
                  //string thumbPath = imagesPath + "Thumb\\";
                  string fullPath = Path.Combine(imagesPath, "Full" + fileName);
                  //string fullPath = imagesPath + "Full\\";
                 // string Bigpath = imagesPath + "big\\";
                  string Bigpath = Path.Combine(imagesPath, "big" + fileName);
                  string Bigpatha = Path.Combine(imagesPath, "biga" + fileName);
                  string Bigpathb = Path.Combine(imagesPath, "bigb" + fileName);
                  //string Bigpatha = imagesPath + "biga\\";
                  //string Bigpathb = imagesPath + "bigb\\";
                  string Bigpathc = Path.Combine(imagesPath, "bigc" + fileName );
                  //string Bigpathc = imagesPath + "bigc\\";
                  //var firstSize = Path.Combine(uploadFolder, "bigsize-" + Path.GetFileName(uploadedFile));
                  ImageModel.ResizeAndSave(thumsise, fileName, model.ImageUploaded.InputStream, 80, true);
                  ImageModel.ResizeAndSave(thumbPath, fileName, model.ImageUploaded.InputStream, 100, true);
                  ImageModel.ResizeAndSave(fullPath, fileName, model.ImageUploaded.InputStream, 500, true);
                  ImageModel.ResizeAndSave(Bigpath, fileName, model.ImageUploaded.InputStream, 200, true);
                  ImageModel.ResizeAndSave(Bigpatha, fileName, model.ImageUploaded.InputStream, 250, true);
                  ImageModel.ResizeAndSave(Bigpathb, fileName, model.ImageUploaded.InputStream, 150, true);
                  ImageModel.ResizeAndSave(Bigpathc, fileName, model.ImageUploaded.InputStream, 50, true);
                  Console.WriteLine("Time is " + System.DateTime.Now);
              }
              Console.WriteLine("Time is "+System.DateTime.Now);
  
              Console.ReadLine();
              return View();
          } 
  </code></pre>