Click here to Skip to main content
15,890,897 members
Home / Discussions / C#
   

C#

 
AnswerRe: Generic FTP Uploader Pin
Eddy Vluggen9-Apr-09 1:17
professionalEddy Vluggen9-Apr-09 1:17 
QuestionPowering down a selected monitor Pin
MarkB7779-Apr-09 0:46
MarkB7779-Apr-09 0:46 
AnswerRe: Powering down a selected monitor Pin
_groo_9-Apr-09 2:47
_groo_9-Apr-09 2:47 
QuestionGet passed milliseconds from Timer [Solved] Pin
Xmen Real 9-Apr-09 0:36
professional Xmen Real 9-Apr-09 0:36 
AnswerRe: Get passed milliseconds from Timer Pin
Rob Philpott9-Apr-09 0:50
Rob Philpott9-Apr-09 0:50 
GeneralRe: Get passed milliseconds from Timer Pin
_groo_9-Apr-09 2:03
_groo_9-Apr-09 2:03 
GeneralRe: Get passed milliseconds from Timer Pin
Rob Philpott9-Apr-09 2:08
Rob Philpott9-Apr-09 2:08 
GeneralRe: Get passed milliseconds from Timer Pin
_groo_9-Apr-09 2:27
_groo_9-Apr-09 2:27 
Good point, resolution of the Now property is in ms, and depends on the system. In Vista it seems to have a 1ms resolution, I just tested it:

// a console app
static void Main(string[] args)
{
  StringBuilder sb = new StringBuilder(16384);
  for (int i = 0; i < 10000; i++)
     sb.AppendLine(String.Format("{0:HH:mm:ss.ffff}", DateTime.Now));

  Console.WriteLine(sb.ToString());
  Console.ReadLine();
}


System.Diagnostics.Stopwatch on the other hand is much more precise:

static void Main(string[] args)
{
  StringBuilder sb = new StringBuilder(16384);
  Stopwatch sw = new Stopwatch(); sw.Start();
  DateTime now = DateTime.Now;
  for (int i = 0; i < 10000; i++)
     sb.AppendLine(String.Format("{0:HH:mm:ss.fffff}", now + sw.Elapsed));

  Console.WriteLine(sb.ToString());
  Console.ReadLine();
}

GeneralRe: Get passed milliseconds from Timer Pin
Rob Philpott9-Apr-09 2:59
Rob Philpott9-Apr-09 2:59 
GeneralRe: Get passed milliseconds from Timer Pin
Luc 6480119-Apr-09 16:24
Luc 6480119-Apr-09 16:24 
AnswerRe: Get passed milliseconds from Timer [modified] Pin
_groo_9-Apr-09 2:17
_groo_9-Apr-09 2:17 
GeneralRe: Get passed milliseconds from Timer Pin
Xmen Real 9-Apr-09 2:39
professional Xmen Real 9-Apr-09 2:39 
QuestionProblem during deserialization Pin
lnmca9-Apr-09 0:24
lnmca9-Apr-09 0:24 
AnswerRe: Problem during deserialization Pin
Rob Philpott9-Apr-09 0:51
Rob Philpott9-Apr-09 0:51 
GeneralRe: Problem during deserialization Pin
lnmca9-Apr-09 1:13
lnmca9-Apr-09 1:13 
GeneralRe: Problem during deserialization Pin
Rob Philpott9-Apr-09 1:21
Rob Philpott9-Apr-09 1:21 
GeneralRe: Problem during deserialization Pin
lnmca9-Apr-09 1:36
lnmca9-Apr-09 1:36 
GeneralRe: Problem during deserialization Pin
Rob Philpott9-Apr-09 1:57
Rob Philpott9-Apr-09 1:57 
GeneralRe: Problem during deserialization Pin
Giorgi Dalakishvili9-Apr-09 2:11
mentorGiorgi Dalakishvili9-Apr-09 2:11 
QuestionUDP Hole Punching/STUN tutorials/SDK? Pin
softwarejaeger9-Apr-09 0:21
softwarejaeger9-Apr-09 0:21 
AnswerRe: UDP Hole Punching/STUN tutorials/SDK? Pin
bewithram4-Jul-09 9:59
bewithram4-Jul-09 9:59 
AnswerRe: UDP Hole Punching/STUN tutorials/SDK? Pin
digichetan4-Sep-09 11:40
digichetan4-Sep-09 11:40 
GeneralRe: UDP Hole Punching/STUN tutorials/SDK? Pin
Cosby5-Dec-09 12:09
Cosby5-Dec-09 12:09 
AnswerRe: UDP Hole Punching/STUN tutorials/SDK? Pin
Cosby7-Dec-09 2:26
Cosby7-Dec-09 2:26 
GeneralRe: UDP Hole Punching/STUN tutorials/SDK? Pin
srdusad17-Apr-10 0:14
srdusad17-Apr-10 0:14 

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.