Hy,
I use the following code to measure it in millisecs:
// Stoppuhr
class Stoppuhr {
long millis;
void starte()
{ millis = System.currentTimeMillis(); }
void stoppe()
{ millis = System.currentTimeMillis() - millis; }
long lies()
{ return millis; }
}
// START STOPUHR
Stoppuhr t = new Stoppuhr();
t.starte();
..... SEARCH
<% t.stoppe(); out.println(t.lies()/1000.000 + " sec"); %>
Mit freundlichen Grüßen
Matthias Schneider
Sedanstrasse 27
D-97082 Wuerzburg (Germany)
web:// www.ng-marketing.com
mail:// [EMAIL PROTECTED]
tel:// 0700 ngmarketing
tel2:// +49 . 931 . 207 410 7
fax:// +49 . 931 . 207 410 8
> -----Original Message-----
> From: Lourival Júnior [mailto:[EMAIL PROTECTED]
> Sent: Thursday, July 27, 2006 2:18 PM
> To: [email protected]
> Subject: Total time of a search
>
> Hi,
>
> Somebody knows how to calculate the total time of a search? Actually a use
> this, but I'm not sure about it:
>
> Date d = new Date();
> int iniTime = (int) d.getTime();//pega o tempo de inicio da execução da
> busca nos índices
>
> //Aqui é executada a busca nos índices.
> try{
> hits = bean.search(query, start + hitsToRetrieve, hitsPerSite, "site",
> sort, reverse);
> } catch (IOException e){
> hits = new Hits(0,new Hit[0]);
> }
>
>
> int end = (int)Math.min(hits.getLength(), start + hitsPerPage);
> int length = end-start;
> int realEnd = (int)Math.min(hits.getLength(), start + hitsToRetrieve);
>
>
> Hit[] show = hits.getHits(start, realEnd-start);
> HitDetails[] details = bean.getDetails(show);
> String[] summaries = bean.getSummary(details, query);
>
> Date d2 = new Date();
> int endTime = (int) d2.getTime();
> int totalTime = endTime-iniTime;//tempo de execução em milisegundos
> double totalTimeInSec = (double)totalTime/(double)1000;
>
> Is it correct?
>
> --
> Lourival Junior
> Universidade Federal do Pará
> Curso de Bacharelado em Sistemas de Informação
> http://www.ufpa.br/cbsi
> Msn: [EMAIL PROTECTED]
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Nutch-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nutch-general