- 浏览: 401215 次
- 性别:
- 来自: 上海
文章分类
- 全部博客 (309)
- xaml C# wpf (0)
- scala java inner clas (1)
- Tools UML Eclipse UML2 (1)
- Timer .NET Framework (1)
- perl (6)
- python function paramter (1)
- Python Docstring (1)
- Python how to compare types (1)
- Python (8)
- java (5)
- C# (76)
- C# WPF (0)
- p4 (0)
- WPF (46)
- .net (6)
- xaml (1)
- javascript (40)
- windows (10)
- scala (4)
- winform (1)
- c++ (48)
- tools (12)
- cmd (1)
- os (0)
- CI (0)
- shell (0)
- C (2)
- haskell (49)
- functional (1)
- tool (1)
- gnu (1)
- linux (1)
- kaskell (0)
- svn (0)
- wcf (3)
- android (1)
最新评论
a centralized timers has benefit over non-centralized timers. the benefit including .
1. have one timers object that excute per page at a time.
2. you can start, stop, resume the timer
3. process of removing the timer callback is trivilized
and one special note about the javascipt garbage collection concering about timers. Increasing the number of simutaneous timer is likely to increase the likelihood of a garbage collection in the browser. this is roughly when the browser goes through and tries to tie up loose ends (removing unused variables, objects, etc...)
below show the framework code that has the centralized timer.
/************************************** *@Summary * this is the central timer declaration which you can cetralized manage all timer object * * the benifit of the centralized timer object is that 1. only one timer running per page at a time. 2. pause and resume 3. process of removing callbacks is trivilized * * special note on that increasing number of simutaneous timers is likely to increase the likelihood of a garbge collection in the browser. Roughly speaking this is when the browser * goes through and tries to tie up any loose ends (removing unused variables, objects, etc.). * @Usage: * * @TODO: * test it. ***************************************/ var timers = { timerID: 0, timers: [], start: function () { if (this.timerID) { return; } (function () { for (var i = 0; i < timers.timers.length; i++) { if (timers.timers[i]() === false) { timers.timers.splice(i, 1); } } // the return value of setTimeout is the timerId timers.timerID = setTimeout(argument.callee, 0); })(); }, stop: function () { clearTimeout(this.timerID); // you have to explicitly set the stored timeId value to 0 this.timerID = 0; }, add: function () { this.timers.push(fn); this.start(); } };
the test code is yet to come.
发表评论
-
javascript - trick to cross browser DOM ready event
2012-08-24 08:23 930the "ready" event ... -
javascript - trick to simulate mouseenter and mouseleave
2012-08-23 08:31 2256Previously we discussed javasc ... -
javascript - trick to simulate the change event
2012-08-22 08:51 1671In the previous discussion a ... -
javascript - trick to simulate bubbling submit event
2012-08-22 08:03 909In the previous discussion abou ... -
javascript - trick to implement bubbling submit event
2012-08-23 07:55 707Following up to the javascrip ... -
javascript - trick to detect bubbling supportability
2012-08-20 22:22 975Event delegation is oe of the b ... -
javascript - trigger event and custom events
2012-08-20 21:58 2084In the previous post - javascri ... -
javascript - trick to handlers management
2012-08-20 08:19 1033We have discussed "javascr ... -
javascript - trick to centralized store
2012-08-20 07:52 823For a number of reasons it's ... -
javascript - trick to fix the event object
2012-08-20 07:47 886Many browsers, especially In ... -
javascript - tricks to deal with colors
2012-08-15 08:34 770There are a couple of ways to r ... -
javascript - trick to manipulate the opacity
2012-08-15 08:26 770All other browsre may have supp ... -
javascript - trick to test visibility of an element
2012-08-15 08:15 525though there is a visible prope ... -
javascript - trick to get and set height and width
2012-08-15 08:05 550when looking at properties t ... -
javascript - trick to set/get attributes that expects px values
2012-08-16 11:00 521When setting a number into a ... -
javascript - trick to get and set CSS style
2012-08-16 11:00 749while it will not be so much tr ... -
javascript - trick to normalize href for IE
2012-08-16 10:59 538IE is again the only browser th ... -
javascript - trick IE form and its expando attribute
2012-08-16 10:59 1044there is a known issue that if ... -
javascript expando and attributes
2012-08-14 08:15 1045expando is something like this ... -
javascript - trick to getText and setText
2012-08-14 07:40 1150it is not as simple as you thin ...
相关推荐
INE出品的SDN视频教程
1. 出租车调度方法:TESLA(centralized taxi dispatching with global fairness),即一种集中式出租车调度方法,旨在通过实时匹配出租车与乘客来提升司机的收入效率,同时解决司机收入公平性问题。 2. 传统出租车...
在IT领域,特别是企业级应用集成与管理方面,"Enhanced Centralized Monitoring and Administration"这一主题探讨了如何通过中央监控和管理策略优化SAP NetWeaver Process Integration (PI) 7.1系统的运行效率和成本...
A_centralized_system_for_displaying_and_stylizing__聚焦聚焦_A_centralized_system_for_displaying_and_stylizing__focus-rings.zip_A_centralized_system_for_displaying_and_stylizing__focus-rings
### 集中式自适应路由在NoC中的应用与优化 #### 核心知识点解析: 1. **NoC(Network-on-Chip)架构与挑战**:随着片上系统(System-on-Chip,SoC)中应用程序和可编程单元数量的激增,NoC面临多样化的、时间依赖...
【船级社】 NK Rules for Centralized Cargo Monitoring and Control Systems 2023.pdf
集中日志系统(Centralized Log System)是一种在大型分布式系统中广泛采用的日志管理解决方案,它将分散在各个节点上的日志数据集中收集、存储和分析,以提供更好的监控、故障排查和运营洞察。这样的系统通常包括...
leach-c matlab source code
【船级社】 490_cargomonitoring_e_2022Rules for Centralized Cargo Monitoring and Control Systems
Nonlocally Centralized Sparse Representation for Image Restoration.ppt 图像处理文献整理报告
集中工作流程(Centralized Workflow)是一种版本控制系统中的工作模式,主要应用于Git等分布式版本系统中。这个模式强调了中央仓库的概念,所有开发人员都向这个中央仓库提交代码更改。在这个练习中,我们将深入...
"Centralized Packages Manager"是一个开源项目,专门设计用于在基于Debian的系统网络中集中管理软件包。这个工具使得IT管理员能够高效地控制和维护多台主机上的软件包配置,确保每台主机按照预设的规则安装或移除...
集中式Salesforce开发框架 ... 最初的大部分代码库都来自Hari Krishnan开发的开源存储库,并在中进行了详细讨论。 在此项目中所做工作的一切功劳归功于他们。 任何错误的全部责任都应该直接归您所有。...
【中央软件许可管理概述】 中央软件许可管理是企业IT管理中的关键组成部分,旨在解决软件许可证的跟踪、分配和优化问题。Embarcadero License Center(ELC)是Embarcadero Technologies提供的一种解决方案,旨在...
【企业集团集中核算】在深化国有企业改革和民营企业迅速发展的背景下,跨行业的大量资产整合、重组并购等业务扩张,催生了大批集团公司的涌现。集团式的组织和管理模式日益复杂多元化,在企业间竞争与资本运作愈发...
讲述分布式天线在无线领域中的具体实施,并对比其与中央天线的性能
Review centralized deployment models for wired/wireless integration Deepen your knowledge of defense by understanding the tools that attackers use to perform reconnaissance and to attack ...
日志服务器 在UDP协议上可靠运行的消息记录服务器。 特征 它可以同时从多个客户端接收日志,并将它们写入后备存储。 日志一到达服务器就不会立即写入,而是在相应的客户端队列中排队。 稍后,守护程序将使队列出队...