473,699 Members | 2,827 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Javascript can get time, can it get milliseconds, or actually just tenths of seconds?

Guy
JavaScript can get time, can it get milliseconds, or actually just tenths of
seconds?
Thanks for all
Guy
Jul 20 '05 #1
2 6267
Lee
Guy said:

JavaScript can get time, can it get milliseconds, or actually just tenths of
seconds?


It depends on the machine it's running on.
It reports the value in milliseconds, but the value that
it receives from the operating system is rarely, if ever
that precise.

Jul 20 '05 #2
JRS: In article <y7************ *******@ursa-nb00s0.nbnet.nb .ca>, seen
in news:comp.lang. javascript, Guy <so*****@somewh ere.nb.ca> posted at
Fri, 5 Dec 2003 02:33:02 :-
JavaScript can get time, can it get milliseconds, or actually just tenths of
seconds?


The ECMA-262 language definition strongly implies that it will get no
better than milliseconds, without being quite as explicit as one might
wish.

D = new Date() always AFAIK sets D to an integer, and the routines for
handling dates make no specified allowance for fractional milliseconds.

In DOS..Win98 browsers, the time changes exactly 0x1800B0 times per 24
nominal hours, which is near 18.2 Hz or 54.9 ms. But the conversion is
to a multiple of 10 ms, so going up 50 or 60 ms each time.

In WinNT browsers, I believe that there are 10 ms steps.

Details for other systems would be welcome.

--
© John Stockton, Surrey, UK. ?@merlyn.demon. co.uk Turnpike v4.00 IE 4 ©
<URL:http://jibbering.com/faq/> Jim Ley's FAQ for news:comp.lang. javascript
<URL:http://www.merlyn.demo n.co.uk/js-index.htm> JS maths, dates, sources.
<URL:http://www.merlyn.demo n.co.uk/> TP/BP/Delphi/JS/&c., FAQ topics, links.
Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
2752
by: Guy | last post by:
I would like to calculate the time it takes to load a picture in tenths of a seconds. So I get the current time, load the image, and once loaded I get the current time again. I would like to know if it took 9.3 seconds or 9.7 seconds or whatever. Can javascript get tenths of a second. Thanks for all, Guy
77
4587
by: Charles Law | last post by:
Hi guys I have a time critical process, running on a worker thread. By "time critical", I mean that certain parts of the process must be completed in a specific time frame. The time when the process starts is not especially important, but it must be complete within a small number of seconds. The operations I am performing do not take a long time (hundreds of milliseconds), but as each part of the process is complete, my worker thread...
8
3025
by: Prometheus Research | last post by:
http://newyork.craigslist.org/eng/34043771.html We need a JavaScript component which will auto-submit a form after a set period has elapsed. The component must display a counter that dynamically shows the minutes and seconds remaining before submission. We have a fairly tight deadline (by 5PM EST, Friday, June 25); we are using a "bounty" in the hope of getting a few good responses in a hurry. BOUNTY: $200 for first place, plus a $50...
1
2062
by: P Mitchell | last post by:
How you set up a field to store for example, 1 min 30.23 secs for a swimmer's time in a database table? Peter
26
55723
by: Pravesh | last post by:
Hi: is there a way to get current system time in milliseconds... which functions and headers?? thanks pravesh
9
7275
by: HL | last post by:
I am using VS 2005 Beta - C# Problem: The Timer fires a few milliseconds before the actual Due-Time Let's say a timer is created in the following manner: System.Threading.Timer m_timer = null; Let's declare a constant Int32 m_TimePeriod = 10000;
2
10833
by: Harlin Seritt | last post by:
How can I take a time given in milliseconds (I am doing this for an uptime script) and convert it to human-friendly time i.e. "4 days, 2 hours, 25 minutes, 10 seonds."? Is there a function from the time module that can do this? Thanks, Harlin Seritt
2
2255
by: WJM | last post by:
I'm looking for some help with a error in the code below. When 119.45 seconds are entered the code returns 01:59.45, but when you enter 119.51 the code returns 02:59.51. But, if I enter 120.00 the code returns 02:00.00. Can anyone help figure out what is happening? Public Function Elasped_Time(TimeElapsed As Double) As String Dim Tenths As Double Dim Seconds As Double
3
5774
by: naurus | last post by:
i'd like to know what set timeout does after its finished. I have a script that starts a timeout right before sending an SJaX request that timesout after 1000 milliseconds and abort()s the SJaX request and sets some things then alerts me that it timed out. After i click ok on the alert, my browser (FF) crashes every time. I'd just like to know what happens after the timeout is finished. Here is my code: var changeBG; function...
0
8687
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9174
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9035
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8914
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7751
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6534
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
3057
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2347
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2009
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.