Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 314327
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T08:11:23+00:00 2026-05-12T08:11:23+00:00

In the method monitorCallback() I write a the time to text file. after writing

  • 0

In the method monitorCallback() I write a the time to text file.
after writing the file I check the FileInfo of file and print it.

I have got the following result:

time = 16/08/2009 14:01:46, mili = 307
time = 16/08/2009 14:01:51, mili = 291
time = 16/08/2009 14:01:56, mili = 291
time = 16/08/2009 14:02:01, mili = 291
time = 16/08/2009 14:02:06, mili = 291
time = 16/08/2009 14:02:11, mili = 291

I can’t understand why the time is change but the Millisecond is stay fixed

 private Timer monitor;
 public Window1()
            {
                InitializeComponent();
                monitor = new Timer(monitorCallback, null, 0, 5000);
            }

    private void monitorCallback(object state)
            {
                string path = @"C:\Test.txt";
                Stream stream = File.OpenWrite(path);
                StreamWriter writer = new StreamWriter(stream);
                writer.WriteLine(DateTime.Now);
                writer.Close();

                FileInfo fileInfo = new FileInfo(path);
                Dispatcher.Invoke(DispatcherPriority.Normal,
                    new Action(delegate
                   {
                         Debug.WriteLine( "time = " + fileInfo.LastWriteTimeUtc + ", mili = " +
     fileInfo.LastWriteTimeUtc.Millisecond);


                   }));

                fileInfo = null;

            }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T08:11:23+00:00Added an answer on May 12, 2026 at 8:11 am

    You are calling this operation exactly every 5000 milliseconds. So if the operation takes less than 1 ms to complete, the millisecond part of the file’s timestamp will not change, e.g:

    • time1 = 16/08/2009 14:01:51.291
    • time2 = 16/08/2009 14:01:56.291 (= time1 + 5000 ms)
    • etc.

    Try changing the interval (e.g. to 5003 ms) to see that the millisecond part is updated.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using method: System.IO.File.Create() After the file gets created, it still remains used by a
Quick method description: I have two tables, lets name them table ONE and table
Every method I write to encode a string in Java using 3DES can't be
A method have some methods and also some methods have other methods. How should
This method should write random chars, but it doesn't write anything at all. I'm
This method... window.getSelection().anchorNode ...tells us where the selection of text STARTS. This method... window.getSelection().focusNode
Method 1: $C_HOME = $ENV{EO_HOME}\\common\\; print $C_HOME; gives C:\work\System11R1\common\ ie The environment variable is
Following method is accepted if I set UIColor like: [tabBarController.tabBar setSelectedImageTintColor:[UIColor greenColor]]; However I
In method that is working in the background, i have two important lines :
method is the most efficient when translating bunches of text/web pages including HTML? I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.