delay := [ :msToWait | | t | t := Time millisecondClockValue. [ (Time millisecondClockValue - t) < msToWait ] whileTrue: [ World doOneCycle ]. ]. delay value: 200. Best regards, Henrik -----Original Message----- From: Pharo-dev [mailto:pharo-dev-bounces@lists.pharo.org] On Behalf Of Ferlicot D. Cyril Sent: Tuesday, October 13, 2015 9:03 PM To: Pharo <pharo-dev@lists.pharo.org> Subject: [Pharo-dev] Question about implementation of a delay Hi, I am building a widget for fast table in order to filter them for Synectique and Pharo. For now I have a Rubric editor where we can write a pattern and I use a Rubric announcement to update the Fast Table. So each time the rubric is update the method #update is call. At the beginning #update was: ---- pattern := self patternFromString: filterField getText asString trimBoth. fastTable dataSource: (initialDataSource newDataSourceMatching: pattern). fastTable refresh ----- But this will update the Fast Table at each character, so I want to add a delay. For example I want to let the user type and update the table if he don't type for 0.2second. The only way I found is this: ---- update: anAnnoucement | pattern timeStamp | timeStamp := DateAndTime now. timestamp := timeStamp copy. [ (Delay forMilliseconds: 200) wait. timeStamp = timestamp ifTrue: [ pattern := self patternFromString: filterField getText asString trimBoth. fastTable dataSource: (initialDataSource newDataSourceMatching: pattern). fastTable refresh ] ] fork ---- But I think that create a new process a each update is really too heavy⦠So I would like to have some advices from experienced people to know if there is a better way to implement a delay. If you want to check the code you can execute: ---- Gofer new smalltalkhubUser: 'estebanlm' project: 'FastTable'; configuration; load. (Smalltalk globals at: #ConfigurationOfFastTable) loadDevelopment. FTFastTableComposer browse ---- -- Cyril Ferlicot http://www.synectique.eu 165 Avenue Bretagne Lille 59000 France