Fix slow event detection
Time moves forward, so the second call to nanoTime returns a bigger number than the first one, giving a negative elapsed time … defeating the whole purpose of this code. :-(
This commit is contained in:
parent
97eef62684
commit
3fe72154a3
@ -377,10 +377,10 @@ public class PluginManager
|
||||
eventBus.post( event );
|
||||
event.postCall();
|
||||
|
||||
long elapsed = start - System.nanoTime();
|
||||
if ( elapsed > 250000 )
|
||||
long elapsed = System.nanoTime() - start;
|
||||
if ( elapsed > 1000000 )
|
||||
{
|
||||
ProxyServer.getInstance().getLogger().log( Level.WARNING, "Event {0} took more {1}ns to process!", new Object[]
|
||||
ProxyServer.getInstance().getLogger().log( Level.WARNING, "Event {0} took more {1} than ns to process!", new Object[]
|
||||
{
|
||||
event, elapsed
|
||||
} );
|
||||
|
Loading…
Reference in New Issue
Block a user