- NSMenu *temporaryMenu = [[menuProvider menuForStatusItem:statusItem] retain];
- [anInvocation setTarget:temporaryMenu];
+ AbsoluteTime diff = SubAbsoluteFromAbsolute(UpTime(),cachedTime);
+
+ if (!menu || diff.lo > 1000000) {
+ [menu release];
+ menu = [[menuProvider menuForStatusItem:statusItem] retain];
+ cachedTime = UpTime();
+ }
+
+ [anInvocation setTarget:menu];