I did a program that connecting to database then show data and user can ( add or remove or update ) data but my problem that program take a little time to be ready how i can know that time and make notification for user to use program now or wait (Program still in loading)
mohamed moamen
0
Light Poster
Recommended Answers
Jump to Postlong start = System.currentTimeMillis(); long end = 0l; long elapsed = 0l; // your code end = System.currentTimeMillis(); elapsed = end - start; System.out.println(("Search Spent " + ((int) (elapsed / 1000)) + " seconds");
but some Java Gurus told that System.nanoTime(); is more precious
Jump to Postwhat you really needed
1) calculate time between two periods,
2) pre-calculate required time and to display that in JProgressBar
3) or entertain the audience (in some way) during the the program works, rotated Icon, change Cursor, diplay some notice...
All 8 Replies
mKorbel
274
Veteran Poster
mohamed moamen
0
Light Poster
mKorbel
274
Veteran Poster
mohamed moamen
0
Light Poster
mKorbel
274
Veteran Poster
JamesCherrill
4,733
Most Valuable Poster
Team Colleague
Featured Poster
ardi_lucy
0
Newbie Poster
mohamed moamen
0
Light Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.