Click here to Skip to main content
15,889,462 members
Home / Discussions / C#
   

C#

 
GeneralRe: Rating my Article Pin
0x3c019-Jan-10 5:12
0x3c019-Jan-10 5:12 
QuestionImporting a win32 dll in C# Pin
yeah100019-Jan-10 1:57
yeah100019-Jan-10 1:57 
AnswerRe: Importing a win32 dll in C# Pin
Luc Pattyn19-Jan-10 2:14
sitebuilderLuc Pattyn19-Jan-10 2:14 
AnswerRe: Importing a win32 dll in C# Pin
Rhys Gravell19-Jan-10 2:37
professionalRhys Gravell19-Jan-10 2:37 
AnswerRe: Importing a win32 dll in C# Pin
KarstenK19-Jan-10 2:51
mveKarstenK19-Jan-10 2:51 
GeneralRe: Importing a win32 dll in C# Pin
Sunil G19-Jan-10 4:35
Sunil G19-Jan-10 4:35 
QuestionSimple profiling question Pin
el_scrub19-Jan-10 1:45
el_scrub19-Jan-10 1:45 
AnswerRe: Simple profiling question Pin
harold aptroot19-Jan-10 1:49
harold aptroot19-Jan-10 1:49 
Why isn't your own sine static?

How about this (untested)
edit: of course you should use the StopWatch class but I'm a bit lazy right now (sorry)
static void Main(string[] args)
 {
     Sin mySin = new Sin();
     double sinValue = 39 * (Math.PI / 180);

     long before = DateTime.Now.Ticks;
     double good;
     for (int i = 0; i < 10000; i++)
         good = Math.Sin(sinValue);

     long after = DateTime.Now.Ticks;

     long result = after - before;

     Console.WriteLine("Sin for {0} = {1}", sinValue, good);
     Console.WriteLine("Time taken for 10k : {0}", result);

     before = DateTime.Now.Ticks;
     double bad;
     for (int i = 0; i < 10000; i++)
         bad = mySin.SinFunction(sinValue , 6);
     after = DateTime.Now.Ticks;

     result = after - before;
     Console.WriteLine("MySin for {0} = {1}", sinValue, bad);
     Console.WriteLine("Time taken for 10k : {0} ", result);

     Console.ReadLine();
 }

GeneralRe: Simple profiling question Pin
harold aptroot19-Jan-10 1:59
harold aptroot19-Jan-10 1:59 
GeneralRe: Simple profiling question Pin
el_scrub19-Jan-10 2:05
el_scrub19-Jan-10 2:05 
AnswerRe: Simple profiling question Pin
Harvey Saayman19-Jan-10 1:49
Harvey Saayman19-Jan-10 1:49 
GeneralRe: Simple profiling question Pin
el_scrub19-Jan-10 2:02
el_scrub19-Jan-10 2:02 
GeneralRe: Simple profiling question Pin
Harvey Saayman19-Jan-10 2:10
Harvey Saayman19-Jan-10 2:10 
AnswerRe: Simple profiling question Pin
Luc Pattyn19-Jan-10 2:17
sitebuilderLuc Pattyn19-Jan-10 2:17 
QuestionObject shape recognition Pin
viki8919-Jan-10 0:48
viki8919-Jan-10 0:48 
AnswerRe: Object shape recognition Pin
Keith Barrow19-Jan-10 0:55
professionalKeith Barrow19-Jan-10 0:55 
GeneralRe: Object shape recognition Pin
viki8919-Jan-10 0:59
viki8919-Jan-10 0:59 
GeneralRe: Object shape recognition Pin
Keith Barrow19-Jan-10 1:13
professionalKeith Barrow19-Jan-10 1:13 
GeneralRe: Object shape recognition Pin
viki8919-Jan-10 1:14
viki8919-Jan-10 1:14 
AnswerRe: Object shape recognition Pin
Ennis Ray Lynch, Jr.19-Jan-10 8:19
Ennis Ray Lynch, Jr.19-Jan-10 8:19 
GeneralRe: Object shape recognition Pin
viki8919-Jan-10 8:31
viki8919-Jan-10 8:31 
AnswerRe: Object shape recognition Pin
Eddy Vluggen19-Jan-10 10:44
professionalEddy Vluggen19-Jan-10 10:44 
QuestionIP Address Error Pin
kk.tvm19-Jan-10 0:41
kk.tvm19-Jan-10 0:41 
AnswerRe: IP Address Error PinPopular
Keith Barrow19-Jan-10 0:50
professionalKeith Barrow19-Jan-10 0:50 
AnswerRe: IP Address Error Pin
Migounette19-Jan-10 12:39
Migounette19-Jan-10 12:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.