473,795 Members | 3,100 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Get the tick count in java

13 New Member
i am writing a program for string matching (for a assignment @ our campus) i want to measure the cpu tick count(or verry accurate time measurement, maybe in icro seconds or so...) to analyze running time.

can i do this in java and f so how?
May 30 '07 #1
3 23421
JosAH
11,448 Recognized Expert MVP
i am writing a program for string matching (for a assignment @ our campus) i want to measure the cpu tick count(or verry accurate time measurement, maybe in icro seconds or so...) to analyze running time.

can i do this in java and f so how?
Read the API documentation for the System class; you'll find a nice method
in there that can do the job for you.

kind regards,

Jos
May 30 '07 #2
shanakard
13 New Member
Read the API documentation for the System class; you'll find a nice method
in there that can do the job for you.

kind regards,

Jos
I m using java 1.4 and i can't seem to find anytinig in the System class except currentTimeMill is() (this is not enough accuracy)

and it still dosen't give me the tick count either(it would be better if i had this rather than the time in nanoseconds or so....)

if U were talking about loadliberary and using windows api or something like that. it would be nice if i had a built in method that is os indipendent

pls if u can give me a hint on what i should search for it would be greate. ThankX anyway
May 30 '07 #3
JosAH
11,448 Recognized Expert MVP
I m using java 1.4 and i can't seem to find anytinig in the System class except currentTimeMill is() (this is not enough accuracy)
A nice trick is to do what you want to measure 'n' times (a million times would
do fine). Get both the start and end times, compute the difference and divide by n.
That compensates somewhat in case the hotspot compiler got fired up.

kind regards,

Jos
May 30 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

7
10879
by: JP Belanger | last post by:
I have a question on select count(), which may betray my lack of database knowledge. Here goes. I have java code driving a transaction which goes like this: select count(*) from table (Java code in the same transaction) if count < 50 then ...
0
1176
by: Daniel Maycock via .NET 247 | last post by:
I can't get my threading timer to show a splash screen panel for six seconds, then move onto the next panel. The timer just doesn't tick (this is aparent when I set the time to wait to 100 and it never fires off the sub) I've tried using java, I've tried using the system timer - this is my last hope - please help! Here's my Code ----------------- Private strConn As String = ConfigurationSettings.AppSettings("conString") Private Sub...
10
2203
by: Martin Eyles | last post by:
Hi, I want to make a scale on a graph, by telling asp to insert empty divs of class tick, and the setting the style in css. I am trying to get a 3D effect by using colored top and bottom borders on the divs, and setting their height to 0. The code bellow show an example tick, and it all looks beautiful in firefox, but in internet explorer, the height appears to be ignored. Does anyone have any ideas? Thanks, Martin
13
1471
by: Brett | last post by:
I have compared, in ms, the time VB.NET and CFMX take to execute code that is nearly exact in their respective languages. The tick count distributions in VB.NET are very tight, ranging from 154 - 190 with no outliers. The CFMX code is distributed in the range 356 - 950 and one outlier at 1356. Why is the VB.NET code distributed very tightly against the mean vs. the CFMX code? Thanks, Brett
5
1601
by: John | last post by:
Hi I have a bound gridview. I need to allow users to select multiple rows and then press the process button to process multiple selected rows. For this I want to use additional column of checkboxes (unbound?) which user can tick. Is there an example of such a scenario somewhere that I can have a look at? Thanks
5
10856
by: not_a_commie | last post by:
So I have a motherboard with multiple CPU sockets. It seems that if I create a StopWatch on one thread and then call the Elapsed member from a different thread that sometimes I get a tick count that's a million miles away. My thinking is that I can subclass the StopWatch. Then when the Elapsed member is called, I can invoke it on the thread that the StopWatch class was created on. True? How? Or is there an easy way that I could scan...
1
2127
by: Inaccessable | last post by:
This is probably very simple but still beyond me. I have a table that stores text in a number of different languages. Each entry has a unique ID number. Each language version of the same text shares the ID number. I have a column of tick boxes that show where this text is used. ie 1.0 English_text_record_1 tickcol1=y tickcol2=n tickcol3=y 1.0 French_text_record_1 tickcol1=y tickcol2=n tickcol3=y 1.0 Spanish_text_record_1...
4
3203
by: paul.bentley | last post by:
I am trying to get a "Date entered" box to automatically fill when a tick box = true, without success so its over to the experts for some much needed help Thanks in advance
18
3114
by: sweeneye | last post by:
Hi, I'm basing a query on the variables used in a form. The database contains lots of problems, say with a computer and a tick box for the apropriate component like monitor, keyboard, mouse etc. and each has several eg problem 1 has a monitor and mouse problem My form then has what to look for tick boxes (tri-state) for each of these. I want my query to include all monitor problems when that is ticked and all monitor and mouse problems...
0
9672
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
10213
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
10163
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
10000
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9037
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
7538
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...
0
6779
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5563
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2920
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.