Results 1 to 9 of 9
Thread: Quick latency testing question..
- 02-17-2009, 05:28 AM #1
Member
- Join Date
- Feb 2009
- Posts
- 32
- Rep Power
- 0
Quick latency testing question..
ok at the beginning of the boolean i have
long start = System.currentTimeMillis();
and at the end i have
long end = System.currentTimeMillis();
long latency = end - start;
How do i make it more precise?
Like System.currentTimeNanos()?
lol
this is what i mean
pastebin*/m21d2c9af
where the * is put .com
ThanksLast edited by Samgetsmoney; 02-17-2009 at 06:02 AM.
-
why do you need timing more precise than milliseconds? Perhaps instead you need to correct your design.
- 02-17-2009, 05:52 AM #3
Member
- Join Date
- Feb 2009
- Posts
- 32
- Rep Power
- 0
Well then help with my design..
Because latency just equals 0 all the time..
-
I'd love to do just that if I had any inkling what the heck you're trying to do. I must have left my mind-reading hat back at work.Well then help with my design
You may wish to provide more detail. A great site to help you formulate your questions so that they are more easily answered can be found here: How To Ask Questions The Smart Way
- 02-17-2009, 05:59 AM #5
Member
- Join Date
- Feb 2009
- Posts
- 32
- Rep Power
- 0
And a quick question why when u do
Thread.sleep(NUMBER);
it never actually sleeps for that long?
- 02-17-2009, 06:03 AM #6
Member
- Join Date
- Feb 2009
- Posts
- 32
- Rep Power
- 0
look at the part where it says pastebin thats what i mean
- 02-17-2009, 02:31 PM #7
The pastebin thing just has the start then end then calculates latency. obviously it will be zero because you're not doing something in between.. Do something that takes a long time in the middle, like printing out 500 pascal's triangles that each have 100 rows:D.
-MK12Tell me if you want a cool Java logo avatar like mine and I'll make you one.
- 02-17-2009, 09:18 PM #8
Member
- Join Date
- Feb 2009
- Posts
- 32
- Rep Power
- 0
yea but when the method is running 100's of times every half second the little bit of latency counts..
And there is code in the middle the commented out stuff was just an example...
So i read up on benchmarks but dont fully understand them..
- 02-17-2009, 09:36 PM #9
Benchmarking links
A couple of articles that discuss Java benchmarking that are referenced a lot:
Robust Java benchmarking, Part 1: Issues
Robust Java benchmarking, Part 2: Statistics and solutions
Luck,
CJSLChris S.
Difficult? This is Mission Impossible, not Mission Difficult. Difficult should be easy.
Similar Threads
-
One last quick question
By jigglywiggly in forum New To JavaReplies: 7Last Post: 01-26-2009, 08:53 AM -
Quick Question
By Graeme in forum New To JavaReplies: 4Last Post: 01-08-2009, 08:01 PM -
Quick Question
By Spenc in forum New To JavaReplies: 3Last Post: 09-22-2008, 02:26 PM -
quick easy question
By jmHoekst in forum New To JavaReplies: 1Last Post: 06-19-2008, 03:28 PM -
Quick Stupid Question
By bluekswing in forum New To JavaReplies: 7Last Post: 01-08-2008, 06:35 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks