943,887 Members | Top Members by Rank

Ad:
  • VB.NET Discussion Thread
  • Unsolved
  • Views: 593
  • VB.NET RSS
Jun 13th, 2008
0

[ask] how to make it faster???

Expand Post »
dear guys...
i have a code but it runs so slowly
i would it to make it fast...can u help me??

what should i do???

VB.NET Syntax (Toggle Plain Text)
  1. Var2 = 0.1
  2. For y = 0 To jlhPro - 1
  3. Do
  4. Var1 = Var2
  5.  
  6. For z = 0 To thn - 1
  7. kata &= data(y, z) & "*" & Var1 & "^" & z + 1 & vbCrLf
  8. Res1 += data(y, z) * Var1 ^ (z + 1)
  9. kata &= "data = " & data(y, z) & vbCrLf
  10. kata &= "res1 = " & Res1 & vbCrLf
  11. Next
  12. Res1 -= invest
  13. kata &= "res1 = " & Res1 & vbCrLf & vbCrLf & vbCrLf
  14. kata &= "=========================================" & vbCrLf
  15.  
  16.  
  17. For z = thn To 1 Step -1
  18. Res2 += z * data(y, z - 1) * Var1 ^ (z - 1) & vbCrLf
  19. kata &= z & "*" & data(y, z - 1) & "*" & Var1 & "^" & (z - 1) & vbCrLf
  20. kata &= "res2 = " & Res2 & vbCrLf
  21. Next
  22.  
  23. Var2 = Var1 - Res1 / Res2
  24. Loop Until Math.Abs(Var1 - Var2) < 0.00000001
  25.  
  26. ir = (1 - Var2) / Var2
  27. kata &= "irr = " & ir * 100 & "% " & vbCrLf
  28. Next
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
allopiloping is offline Offline
8 posts
since Apr 2008
Jun 14th, 2008
0

Re: [ask] how to make it faster???

I did not analyze the algorithm. Concerning the types that are used:
If a program needs to perform many append operations on a string, using a stringbuilder object may be faster than using a string object.

See
http://msdn.microsoft.com/en-us/libr...er(VS.80).aspx
Reputation Points: 25
Solved Threads: 5
Newbie Poster
dadelsen is offline Offline
22 posts
since Jun 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in VB.NET Forum Timeline: text file contains non delimited data into access database
Next Thread in VB.NET Forum Timeline: Booking system





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC